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