forked from mirrors_public/oddlama_nix-config
fix: import upstream (lovesegfault's) changes to hosts structure
This commit is contained in:
parent
c5a5cf14ba
commit
7ff57aa6e4
9 changed files with 148 additions and 54 deletions
18
flake.lock
generated
18
flake.lock
generated
|
@ -109,11 +109,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672780900,
|
"lastModified": 1672954852,
|
||||||
"narHash": "sha256-DxuSn6BdkZapIbg76xzYx1KhVPEZeBexMkt1q/sMVPA=",
|
"narHash": "sha256-xkMJs1KTyKwxVErNdbgC4K6GRHU24Uv2DhbcFtfzLrk=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "54245e1820caabd8a0b53ce4d47e4d0fefe04cd4",
|
"rev": "3ecd5305a41b6dd87f6cdf8cfe83ac07bdc47a0f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -154,11 +154,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672617983,
|
"lastModified": 1672791794,
|
||||||
"narHash": "sha256-68WDiCBs631mbDDk4UAKdGURKcsfW6hjb7wgudTAe5o=",
|
"narHash": "sha256-mqGPpGmwap0Wfsf3o2b6qHJW1w2kk/I6cGCGIU+3t6o=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "0fc9fca9c8d43edd79d33fea0dd8409d7c4580f4",
|
"rev": "9813adc7f7c0edd738c6bdd8431439688bb0cb3d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -199,11 +199,11 @@
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672734157,
|
"lastModified": 1672912243,
|
||||||
"narHash": "sha256-uwUBnv0bN1SO4QVIo8KUx/jxRYCy7cW8kzZa+Qsrw9k=",
|
"narHash": "sha256-QnQeKUjco2kO9J4rBqIBPp5XcOMblIMnmyhpjeaJBYc=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "d0ce0a861260493c6c21f16f59d25076f73cb931",
|
"rev": "a4548c09eac4afb592ab2614f4a150120b29584c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
13
flake.nix
13
flake.nix
|
@ -59,11 +59,14 @@
|
||||||
checks = import ./nix/checks.nix inputs localSystem;
|
checks = import ./nix/checks.nix inputs localSystem;
|
||||||
devShells.default = import ./nix/dev-shell.nix inputs localSystem;
|
devShells.default = import ./nix/dev-shell.nix inputs localSystem;
|
||||||
|
|
||||||
legacyPackages =
|
packages = let
|
||||||
{
|
hostDrvs = import ./nix/host-drvs.nix inputs localSystem;
|
||||||
default = self.packages.${localSystem}.all;
|
default =
|
||||||
}
|
if builtins.hasAttr "${localSystem}" hostDrvs
|
||||||
// (import ./nix/host-drvs.nix inputs localSystem);
|
then {default = self.packages.${localSystem}.${localSystem};}
|
||||||
|
else {};
|
||||||
|
in
|
||||||
|
hostDrvs // default;
|
||||||
|
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit localSystem;
|
inherit localSystem;
|
||||||
|
|
93
hosts/nom/disko.nix
Normal file
93
hosts/nom/disko.nix
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
{
|
||||||
|
nom = {
|
||||||
|
disk = {
|
||||||
|
"Intenso_SSD_3833430-532201046" = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/disk/by-id/ata-Intenso_SSD_3833430-532201046";
|
||||||
|
content = {
|
||||||
|
type = "table";
|
||||||
|
format = "gpt";
|
||||||
|
partitions = [
|
||||||
|
{
|
||||||
|
type = "partition";
|
||||||
|
name = "efi";
|
||||||
|
start = "2048";
|
||||||
|
end = "8GiB";
|
||||||
|
fs-type = "fat32";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "partition";
|
||||||
|
name = "swap";
|
||||||
|
start = "8GiB";
|
||||||
|
end = "100%";
|
||||||
|
content = {
|
||||||
|
type = "swap";
|
||||||
|
randomEncryption = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"Samsung_SSD_980_PRO_1TB_S5GXNX1T325329W" = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/disk/by-id/nvme-Samsung_SSD_980_PRO_1TB_S5GXNX1T325329W";
|
||||||
|
content = {
|
||||||
|
type = "zfs";
|
||||||
|
pool = "rpool";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
zpool = {
|
||||||
|
rpool = {
|
||||||
|
type = "zpool";
|
||||||
|
mode = "mirror";
|
||||||
|
rootFsOptions = {
|
||||||
|
compression = "zstd";
|
||||||
|
acltype = "posix";
|
||||||
|
atime = "off";
|
||||||
|
xattr = "sa";
|
||||||
|
dnodesize = "auto";
|
||||||
|
mountpoint = "none";
|
||||||
|
canmount = "off";
|
||||||
|
devices = "off";
|
||||||
|
encryption = "aes-256-gcm";
|
||||||
|
keyformat = "passphrase";
|
||||||
|
keylocation = "prompt";
|
||||||
|
"autobackup:snap" = "true";
|
||||||
|
"autobackup:home" = "true";
|
||||||
|
};
|
||||||
|
options = {
|
||||||
|
ashift = "12";
|
||||||
|
bootfs = "rpool/root/nixos";
|
||||||
|
};
|
||||||
|
datasets = {
|
||||||
|
"root" = {
|
||||||
|
zfs_type = "filesystem";
|
||||||
|
};
|
||||||
|
"root/nixos" = {
|
||||||
|
zfs_type = "filesystem";
|
||||||
|
options = {
|
||||||
|
canmount = "on";
|
||||||
|
mountpoint = "/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"home" = {
|
||||||
|
zfs_type = "filesystem";
|
||||||
|
};
|
||||||
|
"home/root" = {
|
||||||
|
zfs_type = "filesystem";
|
||||||
|
options = {
|
||||||
|
canmount = "on";
|
||||||
|
mountpoint = "/root";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -12,33 +12,10 @@ with self.pkgs.${system};
|
||||||
hooks = {
|
hooks = {
|
||||||
actionlint.enable = true;
|
actionlint.enable = true;
|
||||||
luacheck.enable = true;
|
luacheck.enable = true;
|
||||||
#nix-linter.enable = true;
|
|
||||||
alejandra.enable = true;
|
alejandra.enable = true;
|
||||||
statix.enable = true;
|
statix.enable = true;
|
||||||
stylua.enable = true;
|
stylua.enable = true;
|
||||||
};
|
};
|
||||||
#settings.nix-linter.checks = [
|
|
||||||
# "DIYInherit"
|
|
||||||
# "EmptyInherit"
|
|
||||||
# "EmptyLet"
|
|
||||||
# "EtaReduce"
|
|
||||||
# "LetInInheritRecset"
|
|
||||||
# "ListLiteralConcat"
|
|
||||||
# "NegateAtom"
|
|
||||||
# "SequentialLet"
|
|
||||||
# "SetLiteralUpdate"
|
|
||||||
# "UnfortunateArgName"
|
|
||||||
# "UnneededRec"
|
|
||||||
# "UnusedArg"
|
|
||||||
# "UnusedLetBind"
|
|
||||||
# "UpdateEmptySet"
|
|
||||||
# "BetaReduction"
|
|
||||||
# "EmptyVariadicParamSet"
|
|
||||||
# "UnneededAntiquote"
|
|
||||||
# "no-FreeLetInFunc"
|
|
||||||
# "no-AlphabeticalArgs"
|
|
||||||
# "no-AlphabeticalBindings"
|
|
||||||
#];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// (deploy-rs.lib.deployChecks self.deploy)
|
// (deploy-rs.lib.deployChecks self.deploy)
|
||||||
|
|
|
@ -8,7 +8,6 @@ with self.pkgs.${system};
|
||||||
cachix
|
cachix
|
||||||
deploy-rs.deploy-rs
|
deploy-rs.deploy-rs
|
||||||
nix-build-uncached
|
nix-build-uncached
|
||||||
#nix-linter
|
|
||||||
alejandra
|
alejandra
|
||||||
ragenix
|
ragenix
|
||||||
rnix-lsp
|
rnix-lsp
|
||||||
|
|
|
@ -6,9 +6,18 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
hosts = (import ./hosts.nix).homeManager.all;
|
hosts = let
|
||||||
|
hostsNix = import ./hosts.nix;
|
||||||
|
in
|
||||||
|
if builtins.hasAttr "homeManager" hostsNix
|
||||||
|
then hostsNix.homeManager
|
||||||
|
else {};
|
||||||
|
|
||||||
genModules = hostName: {homeDirectory, ...}: {config, ...}: {
|
genModules = hostName: {homeDirectory, ...}: {
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [(../hosts + "/${hostName}")];
|
imports = [(../hosts + "/${hostName}")];
|
||||||
nix.registry = {
|
nix.registry = {
|
||||||
nixpkgs.flake = nixpkgs;
|
nixpkgs.flake = nixpkgs;
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
structuredHostDrvs =
|
structuredHostDrvs =
|
||||||
lib.mapAttrsRecursiveCond
|
lib.mapAttrsRecursiveCond
|
||||||
(as: !(as ? "type" && (lib.elem as.type ["home-manager" "nixos"])))
|
(hostAttr: !(hostAttr ? "type" && (lib.elem hostAttr.type ["homeManager" "nixos"])))
|
||||||
(path: _: hostDrvs.${lib.last path})
|
(path: _: hostDrvs.${lib.last path})
|
||||||
hosts;
|
hosts;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
inherit (builtins) attrNames concatMap listToAttrs;
|
inherit (builtins) attrNames concatMap listToAttrs filter;
|
||||||
|
|
||||||
filterAttrs = pred: set:
|
filterAttrs = pred: set:
|
||||||
listToAttrs (concatMap (name: let
|
listToAttrs (concatMap (name: let
|
||||||
|
@ -24,18 +24,31 @@ let
|
||||||
then [{inherit name value;}]
|
then [{inherit name value;}]
|
||||||
else []) (attrNames set));
|
else []) (attrNames set));
|
||||||
|
|
||||||
systemPred = system: (_: v: builtins.match ".*${system}.*" v.hostPlatform != null);
|
removeEmptyAttrs = filterAttrs (_: v: v != {});
|
||||||
|
|
||||||
genFamily = filter: hosts: rec {
|
genSystemGroups = hosts: let
|
||||||
all = filterAttrs filter hosts;
|
systems = ["aarch64-linux" "x86_64-linux"];
|
||||||
|
systemHostGroup = name: {
|
||||||
nixos = genFamily (_: v: v.type == "nixos") all;
|
inherit name;
|
||||||
homeManager = genFamily (_: v: v.type == "home-manager") all;
|
value = filterAttrs (_: host: host.hostPlatform == name) hosts;
|
||||||
|
|
||||||
linux = genFamily (systemPred "-linux") all;
|
|
||||||
|
|
||||||
aarch64-linux = genFamily (systemPred "aarch64-linux") all;
|
|
||||||
x86_64-linux = genFamily (systemPred "x86_64-linux") all;
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
genFamily (_: _: true) hosts
|
removeEmptyAttrs (listToAttrs (map systemHostGroup systems));
|
||||||
|
|
||||||
|
genTypeGroups = hosts: let
|
||||||
|
types = ["homeManager" "nixos"];
|
||||||
|
typeHostGroup = name: {
|
||||||
|
inherit name;
|
||||||
|
value = filterAttrs (_: host: host.type == name) hosts;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
removeEmptyAttrs (listToAttrs (map typeHostGroup types));
|
||||||
|
|
||||||
|
genHostGroups = hosts: let
|
||||||
|
all = hosts;
|
||||||
|
systemGroups = genSystemGroups all;
|
||||||
|
typeGroups = genTypeGroups all;
|
||||||
|
in
|
||||||
|
all // systemGroups // typeGroups // {inherit all;};
|
||||||
|
in
|
||||||
|
genHostGroups hosts
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
hosts = (import ./hosts.nix).nixos.all;
|
hosts = (import ./hosts.nix).nixos;
|
||||||
|
|
||||||
nixRegistry = {
|
nixRegistry = {
|
||||||
nix.registry = {
|
nix.registry = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue