From 32eaca73d0c2a8d09071f6fa2f1aee1ae1db0033 Mon Sep 17 00:00:00 2001 From: josiah Date: Fri, 28 Jul 2023 09:48:30 -0500 Subject: [PATCH] Nixos and nixflake shit. Non working changes. The last of my fucking around with Nix and Flakes prior to killing the nixos portion of my k8s project. This was just too hard to figure out, honestly. Docs around nixflakes suck. They appear to be the future! I believe the hype! But I can't figure out DICK ALL. Committing, will probably rip out once I'm fully over on PM. --- nixos-configs/deploy-rs/flake.nix | 26 +++++++++++ nixos-configs/hosts/hoyden/configuration.nix | 47 ++------------------ nixos-configs/hosts/hoyden/flake.nix | 25 +++++++++++ 3 files changed, 55 insertions(+), 43 deletions(-) create mode 100644 nixos-configs/hosts/hoyden/flake.nix diff --git a/nixos-configs/deploy-rs/flake.nix b/nixos-configs/deploy-rs/flake.nix index 98837fd..1819282 100644 --- a/nixos-configs/deploy-rs/flake.nix +++ b/nixos-configs/deploy-rs/flake.nix @@ -31,6 +31,32 @@ ]; }; + nixosConfigurations.hoyden = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ../hosts/hoyden/configuration.nix + ../common/default.nix + ]; + }; + + deploy.nodes.hoyden = { + hostname = "hoyden"; + user = "root"; + sshUser = "josiah"; + # magicRollback = false; + remoteBuild = false; + path = deploy-rs.lib.x86_64-linux.activate.nixos + self.nixosConfigurations.hoyden; + + # This forces ssh to connect over IPv4. + sshOpts = [ "-4" ]; + + profiles.system = { + path = deploy-rs.lib.x86_64-linux.activate.nixos + self.nixosConfigurations.hoyden; + }; + }; + deploy.nodes.seraph = { hostname = "seraph"; user = "root"; diff --git a/nixos-configs/hosts/hoyden/configuration.nix b/nixos-configs/hosts/hoyden/configuration.nix index 5e4d4a3..96ed24e 100644 --- a/nixos-configs/hosts/hoyden/configuration.nix +++ b/nixos-configs/hosts/hoyden/configuration.nix @@ -4,11 +4,7 @@ { config, pkgs, ... }: -let - unstableTarball = fetchTarball - "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"; - -in { +{ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix ]; @@ -78,26 +74,6 @@ in { }; nix.settings.experimental-features = [ "nix-command" "flakes" ]; - # This is probalby not gonna work, but is a rough analogue to what I did before - # pkgs.writeTextFile { - # name = "plasma-awesome-xsession"; - # destination = "/share/xsessions/plasma-awesome.desktop"; - # text = '' - # [Desktop Entry] - # Type=XSession - # Exec=env KDEWM=/run/current-system/sw/bin/awesome /run/current-system/sw/bin/startplasma-x11 - # DesktopNames=KDE (awesome) - # Name=Plasma (awesome) - # Comment=Plasma by KDE w/awesome - # ''; - # } // { - # providedSessions = [ "plasma-awesome" ]; - # } - - # Configure keymap in X11 - # services.xserver.layout = "us"; - # services.xserver.xkbOptions = "eurosign:e"; - # Enable CUPS to print documents. # services.printing.enable = true; @@ -135,7 +111,7 @@ in { nixpkgs.config = { packageOverrides = pkgs: { - unstable = import unstableTarball { config = config.nixpkgs.config; }; + unstable = import attrs.unstableTarball { config = config.nixpkgs.config; }; }; permittedInsecurePackages = [ "python2.7-certifi-2021.10.8" @@ -146,10 +122,11 @@ in { # build shit morph # ultimately this seems not useful to me; weird errors. nixops - deploy-rs + unstable.deploy-rs autoconf yarn automake + direnv gnumake wget gcc-arm-embedded @@ -286,21 +263,6 @@ in { fsType = "nfs"; }; - # this doens't work right - # fileSystems."/home/josiah/network-share/sainthood/homes" = { - # #device = "//sainthood.home.jowj.net/volume3/homes/"; - # device = "//sainthood.home.jowj.net//volume3/homes/"; - # fsType = "cifs"; - # options = let - # # this line prevents hanging on network split - # automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; - # in ["${automount_opts},credentials=/etc/nixos/smb-secrets"]; - # }; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. networking.firewall.enable = false; # This value determines the NixOS release from which the default @@ -312,4 +274,3 @@ in { system.stateVersion = "21.11"; # Did you read the comment? } - diff --git a/nixos-configs/hosts/hoyden/flake.nix b/nixos-configs/hosts/hoyden/flake.nix new file mode 100644 index 0000000..713907d --- /dev/null +++ b/nixos-configs/hosts/hoyden/flake.nix @@ -0,0 +1,25 @@ +{ + description = "Hoyden's Flake"; + + inputs = { + nixpkgs.url = + "github:nixos/nixpkgs/nixos-22.05"; # change this to your desired NixOS version + # For accessing `deploy-rs`'s utility Nix functions + deploy-rs.url = "github:serokell/deploy-rs"; + unstableTarball = fetchTarball + "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"; + }; + + outputs = { self, nixpkgs, unstableTarball }@attrs: { + nixosConfigurations.hoyden = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = attrs; + modules = [ ./configuration.nix ]; + }; + }; + +} + + + +