switch to nixos-unstable-small, which already finished the xz revert

https://github.com/NixOS/nixpkgs/issues/300055

https://nixpk.gs/pr-tracker.html?pr=300028

Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
ahuston-0 2024-04-03 01:20:56 -04:00 committed by Alice Huston
parent 3552071246
commit 784da650c0
3 changed files with 95 additions and 119 deletions

8
flake.lock generated
View File

@ -281,16 +281,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1711703276, "lastModified": 1712047400,
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", "narHash": "sha256-P1ddj7Anx1zQXyn1RqLcleA3ZL/8cmewWjdm2nR7mc8=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", "rev": "43f956227e7bbcb11aa54ce1294f6b5bdf6c8fad",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-unstable", "ref": "nixos-unstable-small",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

195
flake.nix
View File

@ -27,7 +27,7 @@
}; };
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.11"; nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.11";
systems.url = "github:nix-systems/default"; systems.url = "github:nix-systems/default";
nix-index-database = { nix-index-database = {
@ -147,9 +147,9 @@
} }
); );
src = src = builtins.filterSource (
builtins.filterSource (path: type: type == "directory" || lib.hasSuffix ".nix" (baseNameOf path)) path: type: type == "directory" || lib.hasSuffix ".nix" (baseNameOf path)
./.; ) ./.;
ls = dir: lib.attrNames (builtins.readDir (src + "/${dir}")); ls = dir: lib.attrNames (builtins.readDir (src + "/${dir}"));
lsdir = lsdir =
dir: dir:
@ -258,12 +258,8 @@
++ fileList "modules" ++ fileList "modules"
++ modules ++ modules
++ lib.optional home home-manager.nixosModules.home-manager ++ lib.optional home home-manager.nixosModules.home-manager
++ ++ lib.optional (builtins.elem "minimal" iso) "${toString nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
lib.optional (builtins.elem "minimal" iso) ++ lib.optional (builtins.elem "sd" iso) "${toString nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
"${toString nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
++
lib.optional (builtins.elem "sd" iso)
"${toString nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
++ ( ++ (
if home then if home then
(map (user: { home-manager.users.${user} = import ./users/${user}/home.nix; }) users) (map (user: { home-manager.users.${user} = import ./users/${user}/home.nix; }) users)
@ -276,123 +272,106 @@
buildPlatform = "x86_64-linux"; buildPlatform = "x86_64-linux";
}; };
} }
++ ++ map (
map user:
( {
user: config,
{ lib,
config, pkgs,
lib, ...
pkgs, }@args:
... {
}@args: users.users.${user} = import ./users/${user} (args // { name = "${user}"; });
{ boot.initrd.network.ssh.authorizedKeys =
users.users.${user} = import ./users/${user} (args // { name = "${user}"; }); lib.mkIf server
boot.initrd.network.ssh.authorizedKeys = config.users.users.${user}.openssh.authorizedKeys.keys;
lib.mkIf server sops = lib.mkIf sops {
config.users.users.${user}.openssh.authorizedKeys.keys; secrets."${user}/user-password" = {
sops = lib.mkIf sops { sopsFile = ./users/${user}/secrets.yaml;
secrets."${user}/user-password" = { neededForUsers = true;
sopsFile = ./users/${user}/secrets.yaml; };
neededForUsers = true; };
}; }
}; ) users;
}
)
users;
}; };
in in
(builtins.listToAttrs ( (builtins.listToAttrs (
map map (system: {
(system: { name = system;
name = system; value = constructSystem (
{
hostname = system;
}
// builtins.removeAttrs (import ./systems/${system} { inherit inputs; }) [
"hostname"
"server"
"home"
]
);
}) (lsdir "systems")
))
// (builtins.listToAttrs (
builtins.concatMap (
user:
map (system: {
name = "${user}.${system}";
value = constructSystem ( value = constructSystem (
{ {
hostname = system; hostname = system;
server = false;
users = [ user ];
} }
// builtins.removeAttrs (import ./systems/${system} { inherit inputs; }) [ // builtins.removeAttrs (import ./users/${user}/systems/${system} { inherit inputs; }) [
"hostname" "hostname"
"server" "server"
"home" "users"
] ]
); );
}) }) (lsdir "users/${user}/systems")
(lsdir "systems") ) (lsdir "users")
))
// (builtins.listToAttrs (
builtins.concatMap
(
user:
map
(system: {
name = "${user}.${system}";
value = constructSystem (
{
hostname = system;
server = false;
users = [ user ];
}
// builtins.removeAttrs (import ./users/${user}/systems/${system} { inherit inputs; }) [
"hostname"
"server"
"users"
]
);
})
(lsdir "users/${user}/systems")
)
(lsdir "users")
)); ));
devShell = devShell = lib.mapAttrs (
lib.mapAttrs system: sopsPkgs:
( with nixpkgs.legacyPackages.${system};
system: sopsPkgs: mkShell {
with nixpkgs.legacyPackages.${system}; sopsPGPKeyDirs = [ "./keys" ];
mkShell { nativeBuildInputs = [
sopsPGPKeyDirs = [ "./keys" ]; apacheHttpd
nativeBuildInputs = [ sopsPkgs.sops-import-keys-hook
apacheHttpd ];
sopsPkgs.sops-import-keys-hook packages = [
]; self.formatter.${system}
packages = [ nixpkgs.legacyPackages.${system}.deadnix
self.formatter.${system} ];
nixpkgs.legacyPackages.${system}.deadnix shellHook = (nix-pre-commit.lib.${system}.mkConfig { inherit pkgs config; }).shellHook;
]; }
shellHook = (nix-pre-commit.lib.${system}.mkConfig { inherit pkgs config; }).shellHook; ) sops-nix.packages;
}
)
sops-nix.packages;
hydraJobs = hydraJobs =
{ {
build = ( build = (
recursiveMerge ( recursiveMerge (
(map (map (machine: {
(machine: { ${machine.pkgs.system} = (
${machine.pkgs.system} = ( builtins.listToAttrs (
builtins.listToAttrs ( builtins.filter (v: v != { }) (
builtins.filter (v: v != { }) ( map (
map pkg:
( (
pkg: if (builtins.hasAttr pkg.name pkgsBySystem.${machine.pkgs.system}) then
( {
if (builtins.hasAttr pkg.name pkgsBySystem.${machine.pkgs.system}) then name = pkg.name;
{ value = pkgsBySystem.${machine.pkgs.system}.${pkg.name};
name = pkg.name; }
value = pkgsBySystem.${machine.pkgs.system}.${pkg.name}; else
} { }
else )
{ } ) machine.config.environment.systemPackages
)
)
machine.config.environment.systemPackages
)
) )
); )
}) );
(builtins.attrValues self.nixosConfigurations) }) (builtins.attrValues self.nixosConfigurations))
)
++ [ ++ [
# not fully sure what this is for but it breaks with nixfmt # not fully sure what this is for but it breaks with nixfmt
# (forEachSystem (system: { # (forEachSystem (system: {

View File

@ -49,13 +49,10 @@
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
services.fwupd.package = services.fwupd.package =
(import (import (builtins.fetchTarball {
(builtins.fetchTarball { url = "https://github.com/NixOS/nixpkgs/archive/bb2009ca185d97813e75736c2b8d1d8bb81bde05.tar.gz";
url = "https://github.com/NixOS/nixpkgs/archive/bb2009ca185d97813e75736c2b8d1d8bb81bde05.tar.gz"; sha256 = "sha256:003qcrsq5g5lggfrpq31gcvj82lb065xvr7bpfa8ddsw8x4dnysk";
sha256 = "sha256:003qcrsq5g5lggfrpq31gcvj82lb065xvr7bpfa8ddsw8x4dnysk"; }) { inherit (pkgs) system; }).fwupd;
})
{ inherit (pkgs) system; }
).fwupd;
services.fprintd.enable = false; services.fprintd.enable = false;