nuke flake-utils-plus

This commit is contained in:
chayleaf 2023-05-25 05:02:07 +07:00
parent 4f531a83a9
commit 39fb83a20b
3 changed files with 31 additions and 57 deletions

View file

@ -68,21 +68,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"locked": {
"lastModified": 1644229661,
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -260,8 +245,7 @@
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"notlua": "notlua", "notlua": "notlua",
"nur": "nur", "nur": "nur",
"rust-overlay": "rust-overlay", "rust-overlay": "rust-overlay"
"utils": "utils_2"
} }
}, },
"rust-overlay": { "rust-overlay": {
@ -314,24 +298,6 @@
"repo": "flake-utils", "repo": "flake-utils",
"type": "github" "type": "github"
} }
},
"utils_2": {
"inputs": {
"flake-utils": "flake-utils_2"
},
"locked": {
"lastModified": 1657226504,
"narHash": "sha256-GIYNjuq4mJlFgqKsZ+YrgzWm0IpA4axA3MCrdKYj7gs=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "2bf0f91643c2e5ae38c1b26893ac2927ac9bd82a",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -3,7 +3,6 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
nixos-hardware.url = "github:NixOS/nixos-hardware"; nixos-hardware.url = "github:NixOS/nixos-hardware";
impermanence.url = "github:nix-community/impermanence"; impermanence.url = "github:nix-community/impermanence";
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
@ -30,7 +29,7 @@
}; };
}; };
outputs = inputs@{ self, nixpkgs, utils, nixos-hardware, impermanence, home-manager, nur, nix-gaming, notlua, nixos-mailserver, ... }: outputs = inputs@{ self, nixpkgs, nixos-hardware, impermanence, home-manager, nur, nix-gaming, notlua, nixos-mailserver, ... }:
let let
# IRL-related stuff I'd rather not put into git # IRL-related stuff I'd rather not put into git
priv = priv =
@ -102,26 +101,39 @@
]; ];
}; };
}; };
in utils.lib.mkFlake { in {
inherit self inputs; nixosConfigurations = builtins.mapAttrs (hostname: args @ { system ? "x86_64-linux", modules, ... }:
hostDefaults.modules = [ lib.nixosSystem ({
inherit system;
modules = modules ++ [
{ networking.hostName = hostname; }
./system/modules/vfio.nix ./system/modules/vfio.nix
./system/modules/ccache.nix ./system/modules/ccache.nix
./system/modules/impermanence.nix ./system/modules/impermanence.nix
./system/modules/common.nix ./system/modules/common.nix
impermanence.nixosModule impermanence.nixosModule
(getPrivSys hostname)
{
nix.registry =
builtins.mapAttrs
(_: v: { flake = v; })
(lib.filterAttrs (_: v: v?outputs) inputs);
# add import'able flakes (like nixpkgs) to nix path
environment.etc = lib.mapAttrs'
(name: value: {
name = "nix/inputs/${name}";
value = { source = value.outPath; };
})
(lib.filterAttrs (_: v: builtins.pathExists "${v}/default.nix") inputs);
nix.nixPath = [ "/etc/nix/inputs" ];
}
]; ];
hosts = builtins.mapAttrs (hostname: args @ { system ? "x86_64-linux", modules, ... }: {
inherit system;
modules = modules ++ [ (getPrivSys hostname) ];
extraArgs = {
inherit nixpkgs;
};
specialArgs = { specialArgs = {
inherit lib; inherit lib nixpkgs;
hardware = nixos-hardware.nixosModules; hardware = nixos-hardware.nixosModules;
}; };
} // (builtins.removeAttrs args [ "home" "modules" ])) } // (builtins.removeAttrs args [ "home" "modules" ])))
config; config;
} // { } // {
homeConfigurations = homeConfigurations =

View file

@ -48,10 +48,6 @@
extraOptions = '' extraOptions = ''
experimental-features = nix-command flakes experimental-features = nix-command flakes
''; '';
# from flake-utils-plus: make this flake's nixpkgs available to the whole system
generateNixPathFromInputs = true;
generateRegistryFromInputs = true;
linkInputs = true;
}; };
systemd.services.nix-daemon.serviceConfig.LimitSTACKSoft = "infinity"; systemd.services.nix-daemon.serviceConfig.LimitSTACKSoft = "infinity";
boot.kernelParams = lib.optionals (cfg.resolution != null) [ boot.kernelParams = lib.optionals (cfg.resolution != null) [