refactor
This commit is contained in:
parent
6bc2250b59
commit
6d04251eb7
47
flake.nix
47
flake.nix
|
|
@ -19,31 +19,30 @@
|
|||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
pkgs-stable = nixpkgs-stable.legacyPackages.${system};
|
||||
specialArgs = {
|
||||
inherit pkgs-stable;
|
||||
inherit flake-programs-sqlite;
|
||||
};
|
||||
in {
|
||||
nixosConfigurations = {
|
||||
hyuganatsu = nixpkgs.lib.nixosSystem {
|
||||
in with builtins; with nixpkgs.lib.attrsets; {
|
||||
nixosConfigurations = mapAttrs' (host: _: {
|
||||
name = host;
|
||||
value = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
inherit specialArgs;
|
||||
modules = [ system/hyuganatsu ];
|
||||
specialArgs = {
|
||||
inherit pkgs-stable;
|
||||
inherit flake-programs-sqlite;
|
||||
};
|
||||
modules = [ (./hosts + "/${host}") ];
|
||||
};
|
||||
iyokan = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
inherit specialArgs;
|
||||
modules = [ system/iyokan ];
|
||||
};
|
||||
};
|
||||
homeConfigurations.ahnwuoa = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
extraSpecialArgs = rec {
|
||||
inherit pkgs-stable;
|
||||
username = "ahnwuoa";
|
||||
homeDirectory = "/home/${username}";
|
||||
};
|
||||
modules = [ ./user ];
|
||||
};
|
||||
}) (readDir ./hosts);
|
||||
homeConfigurations = foldl' (a: b: a//b) {} (map (host: let users = ./hosts + "/${host}/users"; in
|
||||
if pathExists users
|
||||
then mapAttrs' (user: _: {
|
||||
name = "${user}@${host}";
|
||||
value = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
extraSpecialArgs = {
|
||||
inherit pkgs-stable;
|
||||
};
|
||||
modules = [ (users + "/${user}") ];
|
||||
};}) (readDir users)
|
||||
else {}
|
||||
) (attrNames (readDir ./hosts)));
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
../common
|
||||
../../system
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
10
hosts/hyuganatsu/users/ahnwuoa/default.nix
Normal file
10
hosts/hyuganatsu/users/ahnwuoa/default.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../../../user
|
||||
];
|
||||
|
||||
home.username = "ahnwuoa";
|
||||
home.homeDirectory = "/home/${config.home.username}";
|
||||
}
|
||||
|
|
@ -1,9 +1,6 @@
|
|||
{ config, pkgs, pkgs-stable, username, homeDirectory, ... }:
|
||||
{ config, pkgs, pkgs-stable, ... }:
|
||||
|
||||
{
|
||||
home.username = username;
|
||||
home.homeDirectory = homeDirectory;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
(pkgs.symlinkJoin {
|
||||
name = "firefox";
|
||||
|
|
@ -11,7 +8,7 @@
|
|||
buildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/firefox \
|
||||
--set HOME "${homeDirectory}/.local/share"
|
||||
--set HOME "${config.home.homeDirectory}/.local/share"
|
||||
'';
|
||||
})
|
||||
alacritty
|
||||
|
|
|
|||
Loading…
Reference in a new issue