Fix correct username not being set
Rather than set username in flake.nix, set a default value in default.nix (since it's always called), and set appropriate values in personal.nix (pixelifytica) and work.nix (elitherl), since the two files are mutually exclusive and only one or the other will be imported.
This commit is contained in:
parent
dc2ccdc7ea
commit
c6a8a7c34e
10
default.nix
10
default.nix
|
@ -1,4 +1,8 @@
|
|||
{username, ...}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Programs
|
||||
./programs/desktop/default.nix
|
||||
|
@ -14,8 +18,8 @@
|
|||
programs.home-manager.enable = true;
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
home = {
|
||||
inherit username;
|
||||
homeDirectory = "/home/${username}";
|
||||
username = lib.mkDefault "pixelifytica";
|
||||
homeDirectory = "/home/${config.home.username}";
|
||||
stateVersion = "23.05";
|
||||
};
|
||||
}
|
||||
|
|
93
flake.nix
93
flake.nix
|
@ -38,12 +38,10 @@
|
|||
...
|
||||
}: let
|
||||
defaultExtraSpecialArgs = {
|
||||
system ? "x86_64-linux",
|
||||
hostname ? "Atlas",
|
||||
username ? "pixelifytica",
|
||||
...
|
||||
hostname,
|
||||
system,
|
||||
}: rec {
|
||||
inherit hostname username;
|
||||
inherit hostname;
|
||||
inherit (plasma-manager.packages.${system}) rc2nix;
|
||||
accentColourName = "base0D";
|
||||
altAccentColourName = "base0C";
|
||||
|
@ -90,53 +88,58 @@
|
|||
};
|
||||
homeConfigurations = {
|
||||
# Server
|
||||
"pixelifytica@Legion" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {system = "x86_64-linux";};
|
||||
modules = defaultModules;
|
||||
extraSpecialArgs = defaultExtraSpecialArgs {
|
||||
system = "x86_64-linux";
|
||||
hostname = "Legion";
|
||||
"pixelifytica@Legion" = let
|
||||
hostname = "Legion";
|
||||
system = "x86_64-linux";
|
||||
in
|
||||
home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
modules = defaultModules;
|
||||
extraSpecialArgs = defaultExtraSpecialArgs {inherit hostname system;};
|
||||
};
|
||||
};
|
||||
# Personal
|
||||
"pixelifytica@Northstar" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {system = "x86_64-linux";};
|
||||
modules =
|
||||
defaultModules
|
||||
++ [
|
||||
./personal.nix
|
||||
{programs.plasma.configFile.kcminputrc."Libinput/1739/52759/SYNA32AA:00 06CB:CE17 Touchpad".NaturalScroll = true;}
|
||||
];
|
||||
extraSpecialArgs = defaultExtraSpecialArgs {
|
||||
system = "x86_64-linux";
|
||||
hostname = "Northstar";
|
||||
"pixelifytica@Northstar" = let
|
||||
hostname = "Northstar";
|
||||
system = "x86_64-linux";
|
||||
in
|
||||
home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
modules =
|
||||
defaultModules
|
||||
++ [
|
||||
./personal.nix
|
||||
{programs.plasma.configFile.kcminputrc."Libinput/1739/52759/SYNA32AA:00 06CB:CE17 Touchpad".NaturalScroll = true;}
|
||||
];
|
||||
extraSpecialArgs = defaultExtraSpecialArgs {inherit hostname system;};
|
||||
};
|
||||
};
|
||||
"pixelifytica@Vanguard" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {system = "x86_64-linux";};
|
||||
modules = defaultModules ++ [./personal.nix];
|
||||
extraSpecialArgs = defaultExtraSpecialArgs {
|
||||
system = "x86_64-linux";
|
||||
hostname = "Vanguard";
|
||||
"pixelifytica@Vanguard" = let
|
||||
hostname = "Vanguard";
|
||||
system = "x86_64-linux";
|
||||
in
|
||||
home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
modules = defaultModules ++ [./personal.nix];
|
||||
extraSpecialArgs = defaultExtraSpecialArgs {inherit hostname system;};
|
||||
};
|
||||
};
|
||||
# Work
|
||||
"elitherl@Tone" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {system = "x86_64-linux";};
|
||||
modules = defaultModules ++ [./work.nix];
|
||||
extraSpecialArgs = defaultExtraSpecialArgs {
|
||||
system = "x86_64-linux";
|
||||
hostname = "Tone";
|
||||
"elitherl@Tone" = let
|
||||
hostname = "Tone";
|
||||
system = "x86_64-linux";
|
||||
in
|
||||
home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
modules = defaultModules ++ [./work.nix];
|
||||
extraSpecialArgs = defaultExtraSpecialArgs {inherit hostname system;};
|
||||
};
|
||||
};
|
||||
"elitherl@Scorch" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {system = "x86_64-linux";};
|
||||
modules = defaultModules ++ [./work.nix];
|
||||
extraSpecialArgs = defaultExtraSpecialArgs {
|
||||
system = "x86_64-linux";
|
||||
hostname = "Scorch";
|
||||
"elitherl@Scorch" = let
|
||||
hostname = "Scorch";
|
||||
system = "x86_64-linux";
|
||||
in
|
||||
home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
modules = defaultModules ++ [./work.nix];
|
||||
extraSpecialArgs = defaultExtraSpecialArgs {inherit hostname system;};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
19
personal.nix
19
personal.nix
|
@ -4,12 +4,15 @@
|
|||
./programs/games/default.nix
|
||||
./programs/streaming/default.nix
|
||||
];
|
||||
home.packages = with pkgs;
|
||||
with kdePackages; [
|
||||
blender
|
||||
freecad
|
||||
prusa-slicer
|
||||
ktorrent
|
||||
noson
|
||||
];
|
||||
home = {
|
||||
username = "pixelifytica";
|
||||
packages = with pkgs;
|
||||
with kdePackages; [
|
||||
blender
|
||||
freecad
|
||||
prusa-slicer
|
||||
ktorrent
|
||||
noson
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
15
work.nix
15
work.nix
|
@ -4,12 +4,15 @@
|
|||
pkgs,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
twinkle
|
||||
teams-for-linux
|
||||
(writeShellScriptBin "ukaea-vpn-connect"
|
||||
"sudo ${openfortivpn}/bin/openfortivpn -c ${./ukaea-vpn.conf}")
|
||||
];
|
||||
home = {
|
||||
username = "elitherl";
|
||||
packages = with pkgs; [
|
||||
twinkle
|
||||
teams-for-linux
|
||||
(writeShellScriptBin "ukaea-vpn-connect"
|
||||
"sudo ${openfortivpn}/bin/openfortivpn -c ${./ukaea-vpn.conf}")
|
||||
];
|
||||
};
|
||||
programs = {
|
||||
git.userEmail = config.accounts.email.accounts.outlook.address;
|
||||
firefox.policies.Homepage.URL = "https://nucleus.ukaea.uk";
|
||||
|
|
Reference in a new issue