made fancier, hosts and users get generated from directory structure now
:3
This commit is contained in:
parent
566ec67fdd
commit
6e1d429869
9 changed files with 40 additions and 94 deletions
34
flake.lock
generated
34
flake.lock
generated
|
@ -54,24 +54,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils_2": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1710146030,
|
|
||||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -126,7 +108,6 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"colmena": "colmena",
|
"colmena": "colmena",
|
||||||
"flake-utils": "flake-utils_2",
|
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable"
|
"nixpkgs-unstable": "nixpkgs-unstable"
|
||||||
|
@ -147,21 +128,6 @@
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
69
flake.nix
69
flake.nix
|
@ -2,9 +2,11 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "nixpkgs/nixos-23.11";
|
nixpkgs.url = "nixpkgs/nixos-23.11";
|
||||||
nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable";
|
nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
|
||||||
colmena.url = "github:zhaofengli/colmena";
|
colmena = {
|
||||||
colmena.inputs.nixpkgs.follows = "nixpkgs";
|
url = "github:zhaofengli/colmena";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-23.11";
|
url = "github:nix-community/home-manager/release-23.11";
|
||||||
|
@ -31,29 +33,33 @@
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
colmenaHive = colmena.lib.makeHive {
|
colmena =
|
||||||
meta = {
|
let
|
||||||
description = "All my NixoS machines";
|
hosts = lib.genAttrs (builtins.attrNames (builtins.readDir ./hosts)) (name: { });
|
||||||
specialArgs = {
|
in
|
||||||
inherit inputs outputs;
|
{
|
||||||
pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; };
|
meta = {
|
||||||
|
description = "All my NixoS machines";
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs outputs;
|
||||||
|
pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; };
|
||||||
|
};
|
||||||
|
nixpkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||||
};
|
};
|
||||||
nixpkgs = import nixpkgs { system = "x86_64-linux"; };
|
|
||||||
};
|
|
||||||
|
|
||||||
defaults = { lib, config, name, ... }: {
|
defaults = { lib, config, name, ... }: {
|
||||||
imports = [ ./hosts/${name} ./profiles/base ];
|
imports = [ ./hosts/${name} ./profiles/base ];
|
||||||
|
|
||||||
home-manager.extraSpecialArgs = {
|
networking.hostName = name;
|
||||||
inherit inputs outputs;
|
|
||||||
pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; };
|
home-manager.extraSpecialArgs = {
|
||||||
|
inherit inputs outputs;
|
||||||
|
pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
} // hosts;
|
||||||
|
|
||||||
bengal = { };
|
colmenaHive = inputs.colmena.lib.makeHive colmena;
|
||||||
ocelot = { };
|
|
||||||
iso = { };
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosConfigurations = { } // colmenaHive.nodes;
|
nixosConfigurations = { } // colmenaHive.nodes;
|
||||||
|
|
||||||
|
@ -62,19 +68,14 @@
|
||||||
homeConfigurations =
|
homeConfigurations =
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||||
mkHome = { user ? "sammy", hostname ? null }:
|
|
||||||
lib.homeManagerConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
modules = [ ./users/${user}/home.nix ] ++ lib.optional (!isNull hostname) (./. + "/users/${user}@${hostname}/home.nix");
|
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit inputs outputs;
|
|
||||||
pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
lib.genAttrs (builtins.attrNames (builtins.readDir ./users)) (name: lib.homeManagerConfiguration {
|
||||||
sammy = mkHome { };
|
inherit pkgs;
|
||||||
"sammy@chansey" = mkHome { hostname = "chansey"; };
|
modules = [ ./users/${name}/home.nix ];
|
||||||
};
|
extraSpecialArgs = {
|
||||||
|
inherit inputs outputs;
|
||||||
|
pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; };
|
||||||
|
};
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
|
||||||
networking.hostName = "bengal";
|
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
|
|
|
@ -27,4 +27,3 @@
|
||||||
# Use faster squashfs compression
|
# Use faster squashfs compression
|
||||||
isoImage.squashfsCompression = "gzip -Xcompression-level 1";
|
isoImage.squashfsCompression = "gzip -Xcompression-level 1";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,5 @@
|
||||||
|
|
||||||
boot.tmp.cleanOnBoot = true;
|
boot.tmp.cleanOnBoot = true;
|
||||||
zramSwap.enable = true;
|
zramSwap.enable = true;
|
||||||
networking.hostName = "ocelot";
|
|
||||||
networking.domain = "";
|
|
||||||
system.stateVersion = "23.11";
|
system.stateVersion = "23.11";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
{ lib, pkgs, ... }: {
|
|
||||||
services.openssh = {
|
|
||||||
enable = true;
|
|
||||||
settings.PasswordAuthentication = lib.mkForce true;
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
htop
|
|
||||||
];
|
|
||||||
|
|
||||||
system.stateVersion = "23.10";
|
|
||||||
}
|
|
|
@ -1,6 +1,7 @@
|
||||||
{ lib, config, pkgs, inputs, ... }: {
|
{ lib, config, pkgs, inputs, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
../../users
|
../../users/root
|
||||||
|
../../users/sammy
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -123,6 +124,4 @@
|
||||||
whois
|
whois
|
||||||
wireguard-tools
|
wireguard-tools
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{ ... }: {
|
|
||||||
imports = [
|
|
||||||
./sammy
|
|
||||||
./root
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,4 +1,7 @@
|
||||||
{ ... }: {
|
{ ... }: {
|
||||||
|
imports = [
|
||||||
|
../sammy/home.nix
|
||||||
|
];
|
||||||
programs.ssh.includes = [
|
programs.ssh.includes = [
|
||||||
"./famedly-config"
|
"./famedly-config"
|
||||||
];
|
];
|
||||||
|
|
Loading…
Add table
Reference in a new issue