add dennis local systems (#60)

This commit is contained in:
Dennis 2024-02-02 22:54:36 +01:00 committed by GitHub
parent 6afd73c990
commit 726c3b208e
3 changed files with 92 additions and 17 deletions

69
flake.lock generated
View File

@ -16,6 +16,29 @@
"type": "gitlab"
}
},
"c3d2-user-module": {
"inputs": {
"nixos-modules": [
"nixos-modules"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1706398214,
"narHash": "sha256-7Lk8sFyEkYGdwinhmgarUrC1niN0iyYm4sQpllxmXq4=",
"ref": "refs/heads/master",
"rev": "6d50ac7797380dde3ada60ceb1aeecf9148cdfb6",
"revCount": 56,
"type": "git",
"url": "https://gitea.c3d2.de/C3D2/nix-user-module.git"
},
"original": {
"type": "git",
"url": "https://gitea.c3d2.de/C3D2/nix-user-module.git"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
@ -24,11 +47,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1706768574,
"narHash": "sha256-4o6TMpzBHO659EiJTzd/EGQGUDdbgwKwhqf3u6b23U8=",
"lastModified": 1706854869,
"narHash": "sha256-MUEwsK16OOG6/j0LZ0R0KhCcvJRKZHVXrBgLX7hZums=",
"owner": "nix-community",
"repo": "fenix",
"rev": "668102037129923cd0fc239d864fce71eabdc6a3",
"rev": "b03d2939685937a327f17df832bf9e8944ed9e3a",
"type": "github"
},
"original": {
@ -112,11 +135,11 @@
"libgit2": {
"flake": false,
"locked": {
"lastModified": 1706265337,
"narHash": "sha256-vl4i0bk1UA6M4QzkoX1eQaocnaeEpkktu1GAZPqEXJg=",
"lastModified": 1697646580,
"narHash": "sha256-oX4Z3S9WtJlwvj0uH9HlYcWv+x1hqp8mhXl7HsLu2f0=",
"owner": "libgit2",
"repo": "libgit2",
"rev": "9b2577f8e0ea5e412040566176636b26843ce67d",
"rev": "45fd9ed7ae1a9b74b957ef4f337bc3c8b3df01b5",
"type": "github"
},
"original": {
@ -180,6 +203,26 @@
"type": "github"
}
},
"nix-index-database": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1706411424,
"narHash": "sha256-BzziJYucEZvdCE985vjPoo3ztWcmUiSQ1wJ2CoT6jCc=",
"owner": "Mic92",
"repo": "nix-index-database",
"rev": "c782f2a4f6fc94311ab5ef31df2f1149a1856181",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "nix-index-database",
"type": "github"
}
},
"nix-pre-commit": {
"inputs": {
"flake-utils": [
@ -228,11 +271,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1706550542,
"narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=",
"lastModified": 1706732774,
"narHash": "sha256-hqJlyJk4MRpcItGYMF+3uHe8HvxNETWvlGtLuVpqLU0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "97b17f32362e475016f942bbdfda4a4a72a8a652",
"rev": "b8b232ae7b8b144397fdb12d20f592e5e7c1a64d",
"type": "github"
},
"original": {
@ -286,11 +329,13 @@
},
"root": {
"inputs": {
"c3d2-user-module": "c3d2-user-module",
"fenix": "fenix",
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"mailserver": "mailserver",
"nix": "nix",
"nix-index-database": "nix-index-database",
"nix-pre-commit": "nix-pre-commit",
"nixos-modules": "nixos-modules",
"nixpkgs": "nixpkgs",
@ -302,11 +347,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1706735270,
"narHash": "sha256-IJk+UitcJsxzMQWm9pa1ZbJBriQ4ginXOlPyVq+Cu40=",
"lastModified": 1706797398,
"narHash": "sha256-UCKJaYBAjyOF7w6exlcPgU6Fp8+YGzMN3ID7rpzxAa8=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "42cb1a2bd79af321b0cc503d2960b73f34e2f92b",
"rev": "850ba2fb6395cb39edef263256f7ba334f9142dc",
"type": "github"
},
"original": {

View File

@ -10,6 +10,11 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
nix-index-database = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nix = {
url = "github:NixOS/nix/latest-release";
inputs.nixpkgs.follows = "nixpkgs";
@ -72,9 +77,17 @@
flake-utils.follows = "flake-utils";
};
};
c3d2-user-module = {
url = "git+https://gitea.c3d2.de/C3D2/nix-user-module.git";
inputs = {
nixpkgs.follows = "nixpkgs";
nixos-modules.follows = "nixos-modules";
};
};
};
outputs = { self, nixpkgs-fmt, nix, home-manager, mailserver, nix-pre-commit, nixos-modules, nixpkgs, sops-nix, ... }:
outputs = { self, nixpkgs-fmt, nix, home-manager, mailserver, nix-pre-commit, nixos-modules, nixpkgs, sops-nix, ... }@inputs:
let
inherit (nixpkgs) lib;
systems = [ "x86_64-linux" "aarch64-linux" ];
@ -84,6 +97,7 @@
pkgsBySystem = forEachSystem (system: import nixpkgs {
inherit system;
overlays = overlayList;
config.allowUnfree = true;
});
src = builtins.filterSource (path: type: type == "directory" || lib.hasSuffix ".nix" (baseNameOf path)) ./.;
@ -178,7 +192,7 @@
(builtins.listToAttrs (map
(system: {
name = system;
value = constructSystem ({ hostname = system; } // builtins.removeAttrs (import ./systems/${system} { }) [ "hostname" "server" "home" ]);
value = constructSystem ({ hostname = system; } // builtins.removeAttrs (import ./systems/${system} { inherit inputs; }) [ "hostname" "server" "home" ]);
})
(lsdir "systems"))) // (builtins.listToAttrs (builtins.concatMap
(user:
@ -189,7 +203,7 @@
hostname = system;
server = false;
users = [ user ];
} // builtins.removeAttrs (import ./users/${user}/systems/${system} { }) [ "hostname" "server" "users" ]);
} // builtins.removeAttrs (import ./users/${user}/systems/${system} { inherit inputs; }) [ "hostname" "server" "users" ]);
})
(lsdir "users/${user}/systems"))
(lsdir "users")));
@ -223,6 +237,22 @@
}))
]
));
};
} // lib.mapAttrs (_: lib.hydraJob) (
let
getBuildEntryPoint = name: nixosSystem:
let
cfg =
if (lib.hasPrefix "iso" name) then
nixosSystem.config.system.build.isoImage
else
nixosSystem.config.system.build.toplevel;
in
if nixosSystem.config.nixpkgs.system == "aarch64-linux" then
lib.recursiveUpdate cfg { meta.timeout = 24 * 60 * 60; }
else
cfg;
in
lib.mapAttrs getBuildEntryPoint self.nixosConfigurations
);
};
}

View File

@ -10,7 +10,7 @@
trunk
wasm-pack
cargo-watch
#pkgs.cargo-tarpaulin
# pkgs.cargo-tarpaulin
cargo-generate
cargo-audit
cargo-update