diff --git a/base.nix b/base.nix index a23cc7d..ab1c0c2 100644 --- a/base.nix +++ b/base.nix @@ -1,4 +1,9 @@ { config, pkgs, lib, inputs, ... }: + +let + isTier1 = (builtins.elem config.nixpkgs.system [ "x86_64-linux" "aarch64_linux"]); +in + { imports = let ifExists = p: if builtins.pathExists p then p else {}; in [ ./cachix.nix # update with `cachix use --mode nixos -d . FOOBAR` @@ -7,6 +12,8 @@ # nice to have if i just dump this flake into /etc/nixos on a clean install (ifExists ./configuration.nix ) (ifExists ./hardware-configuration.nix ) + ] ++ lib.optionals isTier1 [ + ./profiles/upgrade-diff.nix ]; nixpkgs.config.permittedInsecurePackages = [ @@ -26,7 +33,7 @@ smartmontools testdisk usbutils - ] ++ lib.optionals (builtins.elem config.nixpkgs.system [ "x86_64-linux" "aarch64_linux"]) [ + ] ++ lib.optionals isTier1 [ cage weston ]; diff --git a/flake.nix b/flake.nix index 08bd8fb..c851ee7 100644 --- a/flake.nix +++ b/flake.nix @@ -30,7 +30,7 @@ # https://github.com/NixOS/nixos-hardware nixos-hardware.url = "github:NixOS/nixos-hardware"; - # https://github.com/NixOS/nixos-hardware + # https://github.com/tfc/nspawn-nixos nixos-nspawn.url = "github:tfc/nspawn-nixos"; nixos-nspawn.flake = false; # we don't use it /shrug @@ -53,7 +53,6 @@ sops-nix-2305.inputs.nixpkgs.follows = "nixpkgs-2305"; sops-nix-2305.inputs.nixpkgs-stable.follows = "nixpkgs-2305"; - /** / https://willbush.dev/blog/impermanent-nixos/ matrix-next.url = "github:dali99/nixos-matrix-modules"; # see https://git.pvv.ntnu.no/Drift/pvv-nixos-config/src/main/flake.nix @@ -254,15 +253,16 @@ nspawn = ls [ "${nixos-nspawn}/nspawn-image.nix" { boot.isContainer = true; } ]; hidpi = hw.common-hidpi; p1005 = ./hardware/printer/hp-laserjet-p1005.nix; + au = ./profiles/auto-upgrade.nix; in builtins.mapAttrs (hostname: curried: curried hostname) { #hostname "domain" "system" inputs "state" [ modules ... ] - noximilien = mk "pbsds.net" "x86_64-linux" inputs-2311 "22.11" [ intel ]; - brumlebasse = mk "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ amd nspawn ]; - nord = mk "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ intel-novga hw.common-cpu-intel-sandy-bridge rocm hidpi ]; - sopp = mk "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ intel cuda p1005 ]; - bolle = mk "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ intel ]; - eple = mk "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ intel ]; - garp = mk "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ intel-novga cuda ]; + noximilien = mk "pbsds.net" "x86_64-linux" inputs-2311 "22.11" [ au intel ]; + brumlebasse = mk "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ au amd nspawn ]; + nord = mk "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ au intel-novga hw.common-cpu-intel-sandy-bridge rocm hidpi ]; + sopp = mk "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ au intel cuda p1005 ]; + bolle = mk "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ au intel ]; + eple = mk "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ au intel ]; + garp = mk "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ au intel-novga cuda ]; hasselknippe= mk "pbsds.net" "aarch64-linux" inputs-2311 "23.11" [ hw.pine64-pinebook-pro ]; #gomperud smattkuken skrytebiffen skalkesnerken balleby bingus skjrlaltatjlstad #bergjlot snortheimsmoen ditlefsen skrukkerud podebusk zmaragd makrell alfnes blix urke pytte uddu imdorf rosenqvist diff --git a/hosts/bolle/default.nix b/hosts/bolle/default.nix index 04fd39b..5f4576d 100644 --- a/hosts/bolle/default.nix +++ b/hosts/bolle/default.nix @@ -7,8 +7,6 @@ imports = [ ./hardware-configuration.nix - ../../profiles/auto-upgrade.nix - ../../profiles/upgrade-diff.nix ../../profiles/sshd.nix ../../users/pbsds diff --git a/hosts/brumlebasse/default.nix b/hosts/brumlebasse/default.nix index d5996b7..bbdee4e 100644 --- a/hosts/brumlebasse/default.nix +++ b/hosts/brumlebasse/default.nix @@ -12,8 +12,6 @@ imports = [ #./hardware-configuration.nix - ../../profiles/auto-upgrade.nix - ../../profiles/upgrade-diff.nix ../../profiles/sshd.nix ../../users/pbsds diff --git a/hosts/eple/default.nix b/hosts/eple/default.nix index 25602a9..7068b89 100644 --- a/hosts/eple/default.nix +++ b/hosts/eple/default.nix @@ -7,8 +7,6 @@ imports = [ ./hardware-configuration.nix - ../../profiles/auto-upgrade.nix - ../../profiles/upgrade-diff.nix ../../profiles/sshd.nix ../../users/pbsds diff --git a/hosts/garp/default.nix b/hosts/garp/default.nix index 9683320..bcd6e81 100644 --- a/hosts/garp/default.nix +++ b/hosts/garp/default.nix @@ -22,8 +22,6 @@ imports = [ ./hardware-configuration.nix - ../../profiles/auto-upgrade.nix - ../../profiles/upgrade-diff.nix ../../profiles/sshd.nix #../../profiles/no-suspend.nix #../../profiles/podman.nix diff --git a/hosts/nord/default.nix b/hosts/nord/default.nix index ae3660f..318fe1b 100644 --- a/hosts/nord/default.nix +++ b/hosts/nord/default.nix @@ -15,8 +15,6 @@ imports = [ ./hardware-configuration.nix - ../../profiles/auto-upgrade.nix - ../../profiles/upgrade-diff.nix ../../profiles/sshd.nix ../../users/pbsds diff --git a/hosts/noximilien/default.nix b/hosts/noximilien/default.nix index 4f0650e..3e1580b 100644 --- a/hosts/noximilien/default.nix +++ b/hosts/noximilien/default.nix @@ -6,8 +6,6 @@ boot.loader.grub.useOSProber = true; imports = [ ./hardware-configuration.nix - ../../profiles/auto-upgrade.nix - ../../profiles/upgrade-diff.nix ../../profiles/sshd.nix ../../profiles/podman.nix diff --git a/hosts/sopp/default.nix b/hosts/sopp/default.nix index 02474d7..8b7c25c 100644 --- a/hosts/sopp/default.nix +++ b/hosts/sopp/default.nix @@ -22,8 +22,6 @@ imports = [ ./hardware-configuration.nix - ../../profiles/auto-upgrade.nix - ../../profiles/upgrade-diff.nix ../../profiles/sshd.nix ../../profiles/no-suspend.nix ../../profiles/podman.nix diff --git a/profiles/auto-upgrade.nix b/profiles/auto-upgrade.nix index d628924..ea66700 100644 --- a/profiles/auto-upgrade.nix +++ b/profiles/auto-upgrade.nix @@ -1,6 +1,6 @@ { config, pkgs, lib, inputs, ... }: { - # 'nixos-rebuild switch --upgrade', by default daily with no reboot + system.autoUpgrade.enable = true; #system.autoUpgrade.allowReboot = true; # reboot after a kernel (module) or initrd upgrade, consider also setting `rebootWindow` @@ -26,10 +26,6 @@ #system.autoUpgrade.flake = "github:pbsds/nix-config"; # TODO: use this instead? system.autoUpgrade.flags = [ "--recreate-lock-file" # fetch new inputs - #"--update-input" "nixpkgs" - #"--update-input" "unstable" - #"--update-input" "home-manager" - #"--update-input" "nixos-hardware" "--no-write-lock-file" # no write new flakelock, as the in-store flake is read-only "-L" # print build logs ]; diff --git a/profiles/shell/nix-utils.nix b/profiles/shell/nix-utils.nix index adf4d9a..9a7b3c8 100644 --- a/profiles/shell/nix-utils.nix +++ b/profiles/shell/nix-utils.nix @@ -1,18 +1,10 @@ { pkgs, ... }: { environment.systemPackages = with pkgs; [ - cachix nix-output-monitor - nix-prefetch nix-top - #nix-index - nix-tree nix-search-cli # nix-search nix-diff - #comma - nixfmt - alejandra - #nixpkgs-hammering - #nixpkgs-review + comma ]; } diff --git a/users/pbsds/home/profiles/shell.nix b/users/pbsds/home/profiles/shell.nix index 9546ff3..269c7c2 100644 --- a/users/pbsds/home/profiles/shell.nix +++ b/users/pbsds/home/profiles/shell.nix @@ -30,7 +30,7 @@ ''; imports = [ ../modules/jump.nix ]; - programs.jump.enableBash = true; # TODO: upstream? + programs.jump.enableBash = true; # TODO: upstream? export in flake? programs.nix-index.enable = true; programs.nix-index-database.comma.enable = true; # via nix-index-database flake