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
34
flake.lock
|
@ -54,24 +54,6 @@
|
|||
"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": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
@ -126,7 +108,6 @@
|
|||
"root": {
|
||||
"inputs": {
|
||||
"colmena": "colmena",
|
||||
"flake-utils": "flake-utils_2",
|
||||
"home-manager": "home-manager",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable"
|
||||
|
@ -147,21 +128,6 @@
|
|||
"repo": "nixpkgs",
|
||||
"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",
|
||||
|
|
69
flake.nix
69
flake.nix
|
@ -2,9 +2,11 @@
|
|||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-23.11";
|
||||
nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
colmena.url = "github:zhaofengli/colmena";
|
||||
colmena.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
colmena = {
|
||||
url = "github:zhaofengli/colmena";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-23.11";
|
||||
|
@ -31,29 +33,33 @@
|
|||
};
|
||||
});
|
||||
|
||||
colmenaHive = colmena.lib.makeHive {
|
||||
meta = {
|
||||
description = "All my NixoS machines";
|
||||
specialArgs = {
|
||||
inherit inputs outputs;
|
||||
pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; };
|
||||
colmena =
|
||||
let
|
||||
hosts = lib.genAttrs (builtins.attrNames (builtins.readDir ./hosts)) (name: { });
|
||||
in
|
||||
{
|
||||
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, ... }: {
|
||||
imports = [ ./hosts/${name} ./profiles/base ];
|
||||
defaults = { lib, config, name, ... }: {
|
||||
imports = [ ./hosts/${name} ./profiles/base ];
|
||||
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit inputs outputs;
|
||||
pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; };
|
||||
networking.hostName = name;
|
||||
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit inputs outputs;
|
||||
pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
} // hosts;
|
||||
|
||||
bengal = { };
|
||||
ocelot = { };
|
||||
iso = { };
|
||||
};
|
||||
colmenaHive = inputs.colmena.lib.makeHive colmena;
|
||||
|
||||
nixosConfigurations = { } // colmenaHive.nodes;
|
||||
|
||||
|
@ -62,19 +68,14 @@
|
|||
homeConfigurations =
|
||||
let
|
||||
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
|
||||
{
|
||||
sammy = mkHome { };
|
||||
"sammy@chansey" = mkHome { hostname = "chansey"; };
|
||||
};
|
||||
lib.genAttrs (builtins.attrNames (builtins.readDir ./users)) (name: lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
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;
|
||||
|
||||
networking.hostName = "bengal";
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
services.printing.enable = true;
|
||||
|
|
|
@ -27,4 +27,3 @@
|
|||
# Use faster squashfs compression
|
||||
isoImage.squashfsCompression = "gzip -Xcompression-level 1";
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,5 @@
|
|||
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
zramSwap.enable = true;
|
||||
networking.hostName = "ocelot";
|
||||
networking.domain = "";
|
||||
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, ... }: {
|
||||
imports = [
|
||||
../../users
|
||||
../../users/root
|
||||
../../users/sammy
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
];
|
||||
|
||||
|
@ -123,6 +124,4 @@
|
|||
whois
|
||||
wireguard-tools
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
./sammy
|
||||
./root
|
||||
];
|
||||
}
|
|
@ -1,4 +1,7 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
../sammy/home.nix
|
||||
];
|
||||
programs.ssh.includes = [
|
||||
"./famedly-config"
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue