Reorganize dotfiles. Rename joey-laptop to laptop Move 'inputs.vars' to let...in... block Fix instances where user name was stated literally

This commit is contained in:
Joey Hafner 2024-10-29 12:31:15 -07:00
parent 3230bb448e
commit 00b4014283
63 changed files with 295 additions and 130 deletions

View File

@ -147,7 +147,43 @@
"type": "github" "type": "github"
} }
}, },
"deploy-rs": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": "nixpkgs",
"utils": "utils"
},
"locked": {
"lastModified": 1727447169,
"narHash": "sha256-3KyjMPUKHkiWhwR91J1YchF6zb6gvckCAY1jOE+ne0U=",
"owner": "serokell",
"repo": "deploy-rs",
"rev": "aa07eb05537d4cd025e2310397a6adcedfe72c76",
"type": "github"
},
"original": {
"owner": "serokell",
"repo": "deploy-rs",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
@ -161,7 +197,7 @@
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
} }
}, },
"flake-compat_2": { "flake-compat_3": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1650374568, "lastModified": 1650374568,
@ -177,7 +213,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_3": { "flake-compat_4": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1673956053, "lastModified": 1673956053,
@ -194,15 +230,12 @@
} }
}, },
"flake-utils": { "flake-utils": {
"inputs": {
"systems": "systems_2"
},
"locked": { "locked": {
"lastModified": 1694529238, "lastModified": 1659877975,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -213,7 +246,7 @@
}, },
"flake-utils-plus": { "flake-utils-plus": {
"inputs": { "inputs": {
"flake-utils": "flake-utils" "flake-utils": "flake-utils_2"
}, },
"locked": { "locked": {
"lastModified": 1696331477, "lastModified": 1696331477,
@ -230,6 +263,24 @@
} }
}, },
"flake-utils_2": { "flake-utils_2": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"inputs": { "inputs": {
"systems": [ "systems": [
"stylix", "stylix",
@ -364,7 +415,7 @@
"nixpkgs": [ "nixpkgs": [
"nixpkgs-unstable" "nixpkgs-unstable"
], ],
"systems": "systems", "systems": "systems_2",
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
@ -502,9 +553,28 @@
"type": "github" "type": "github"
} }
}, },
"nixgl": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1713543440,
"narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=",
"owner": "nix-community",
"repo": "nixGL",
"rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixGL",
"type": "github"
}
},
"nixos-conf-editor": { "nixos-conf-editor": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
@ -526,16 +596,32 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1726320982, "lastModified": 1702272962,
"narHash": "sha256-RuVXUwcYwaUeks6h3OLrEmg14z9aFXdWppTWPMTwdQw=", "narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8f7492cce28977fbf8bd12c72af08b1f6c7c3e49", "rev": "e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-24.05", "ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1729973466,
"narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "cd3e8833d70618c4eea8df06f95b364b016d4950",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -556,6 +642,37 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1660551188,
"narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1726320982,
"narHash": "sha256-RuVXUwcYwaUeks6h3OLrEmg14z9aFXdWppTWPMTwdQw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8f7492cce28977fbf8bd12c72af08b1f6c7c3e49",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"plasma-manager": { "plasma-manager": {
"inputs": { "inputs": {
"home-manager": [ "home-manager": [
@ -581,19 +698,22 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"deploy-rs": "deploy-rs",
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland", "hyprland": "hyprland",
"nix-flatpak": "nix-flatpak", "nix-flatpak": "nix-flatpak",
"nixgl": "nixgl",
"nixos-conf-editor": "nixos-conf-editor", "nixos-conf-editor": "nixos-conf-editor",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_3",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"plasma-manager": "plasma-manager", "plasma-manager": "plasma-manager",
"sops-nix": "sops-nix",
"stylix": "stylix" "stylix": "stylix"
} }
}, },
"snowfall-lib": { "snowfall-lib": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_3",
"flake-utils-plus": "flake-utils-plus", "flake-utils-plus": "flake-utils-plus",
"nixpkgs": [ "nixpkgs": [
"nixos-conf-editor", "nixos-conf-editor",
@ -614,6 +734,27 @@
"type": "github" "type": "github"
} }
}, },
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1729999681,
"narHash": "sha256-qm0uCtM9bg97LeJTKQ8dqV/FvqRN+ompyW4GIJruLuw=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "1666d16426abe79af5c47b7c0efa82fd31bf4c56",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
},
"stylix": { "stylix": {
"inputs": { "inputs": {
"base16": "base16", "base16": "base16",
@ -623,14 +764,14 @@
"base16-kitty": "base16-kitty", "base16-kitty": "base16-kitty",
"base16-tmux": "base16-tmux", "base16-tmux": "base16-tmux",
"base16-vim": "base16-vim", "base16-vim": "base16-vim",
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_4",
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_3",
"gnome-shell": "gnome-shell", "gnome-shell": "gnome-shell",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"systems": "systems_3" "systems": "systems_4"
}, },
"locked": { "locked": {
"lastModified": 1726170940, "lastModified": 1726170940,
@ -647,21 +788,6 @@
} }
}, },
"systems": { "systems": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"systems_2": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -676,6 +802,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_2": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"systems_3": { "systems_3": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
@ -691,6 +832,39 @@
"type": "github" "type": "github"
} }
}, },
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"xdph": { "xdph": {
"inputs": { "inputs": {
"hyprland-protocols": "hyprland-protocols", "hyprland-protocols": "hyprland-protocols",

View File

@ -30,21 +30,7 @@
url = "github:Mic92/sops-nix"; url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
deploy-rs.url = "github:serokell/deploy-rs"; deploy-rs.url = "github:serokell/deploy-rs";
vars = {
"joey-laptop" = {
username = "joey";
hostname = "joey-laptop";
theme = "gruvbox-warm";
wm = "hyprland";
};
"joey-desktop" = {
realname = "Joey Hafner";
username = "joey";
hostname = "joey-desktop";
email = "joey@jafner.net";
};
};
}; };
outputs = inputs@{ outputs = inputs@{
nixpkgs, nixpkgs,
@ -55,6 +41,20 @@
... ...
}: }:
let let
vars = {
user = {
username = "joey";
realname = "Joey Hafner";
email = "joey@jafner.net";
};
laptop = {
hostname = "joey-laptop";
theme = "gruvbox-warm";
};
desktop = {
hostname = "joey-desktop";
};
};
system = "x86_64-linux"; system = "x86_64-linux";
lib = nixpkgs.lib; lib = nixpkgs.lib;
pkgs = import inputs.nixpkgs { pkgs = import inputs.nixpkgs {
@ -69,39 +69,37 @@
}; };
in { in {
nixosConfigurations = { nixosConfigurations = {
joey-laptop = lib.nixosSystem { laptop = lib.nixosSystem {
modules = [ modules = [
./nixos/joey-laptop/configuration.nix ./nixos/laptop/configuration.nix
inputs.hyprland.nixosModules.default inputs.hyprland.nixosModules.default
inputs.stylix.nixosModules.stylix inputs.stylix.nixosModules.stylix
inputs.nix-flatpak.nixosModules.nix-flatpak inputs.nix-flatpak.nixosModules.nix-flatpak
]; ];
inherit system; inherit system;
specialArgs = { specialArgs = {
inherit pkgs; inherit pkgs pkgs-unstable inputs;
inherit pkgs-unstable; inherit vars;
inherit inputs;
}; };
}; };
}; };
homeConfigurations = { homeConfigurations = {
"joey-laptop" = home-manager.lib.homeManagerConfiguration { laptop = home-manager.lib.homeManagerConfiguration {
modules = [ modules = [
./home-manager/joey-laptop/home.nix ./home-manager/laptop/home.nix
inputs.stylix.homeManagerModules.stylix inputs.stylix.homeManagerModules.stylix
inputs.plasma-manager.homeManagerModules.plasma-manager inputs.plasma-manager.homeManagerModules.plasma-manager
inputs.nix-flatpak.homeManagerModules.nix-flatpak inputs.nix-flatpak.homeManagerModules.nix-flatpak
]; ];
inherit pkgs; inherit pkgs;
extraSpecialArgs = { extraSpecialArgs = {
inherit pkgs; inherit pkgs pkgs-unstable inputs;
inherit pkgs-unstable; inherit vars;
inherit inputs;
}; };
}; };
"joey-desktop" = home-manager.lib.homeManagerConfiguration { desktop = home-manager.lib.homeManagerConfiguration {
modules = [ modules = [
./home-manager/joey-desktop/home.nix ./home-manager/desktop/home.nix
inputs.sops-nix.homeManagerModules.sops inputs.sops-nix.homeManagerModules.sops
inputs.stylix.homeManagerModules.stylix inputs.stylix.homeManagerModules.stylix
inputs.nix-flatpak.homeManagerModules.nix-flatpak inputs.nix-flatpak.homeManagerModules.nix-flatpak
@ -109,9 +107,8 @@
]; ];
inherit pkgs; inherit pkgs;
extraSpecialArgs = { extraSpecialArgs = {
inherit pkgs; inherit pkgs pkgs-unstable inputs;
inherit pkgs-unstable; inherit vars;
inherit inputs;
}; };
}; };
}; };

View File

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

@ -1,16 +0,0 @@
{ ... }:
{
## Git
programs.git = {
enable = true;
userName = "Joey Hafner";
userEmail = "joey@jafner.net";
extraConfig = {
core.sshCommand = "ssh -i /home/joey/.ssh/joey@joey-laptop";
};
delta.enable = true;
delta.options = {
side-by-side = true;
};
};
}

View File

@ -1,6 +0,0 @@
{ inputs, ... }:
{
home.stateVersion = "24.05";
imports = [ ./users/${inputs.homeConf.username}.nix ];
}

View File

@ -1,31 +0,0 @@
{ pkgs, ... }:
{
home.username = "joey";
home.homeDirectory = "/home/joey";
imports = [
../style.nix
../app/browser/zen.nix
../app/flatpak/flatpak.nix
../app/git/git.nix
../app/games/games.nix
../app/media/media.nix
../app/messaging/discord.nix
../app/obs-studio/obs-studio.nix
../app/bitwarden/bitwarden.nix
../app/sh/sh.nix # Consider splitting out to "terminal", "shell", and "cmd" or similar
../app/vscode/vscode.nix # Consider using a generalized "IDE" or "Editor" folder.
../wm/hyprland/wm.nix
];
# Desktop apps
home.packages = with pkgs; [
git
kdePackages.kdeconnect-kde
];
programs.home-manager = {
enable = true;
};
}

View File

@ -0,0 +1,16 @@
{ vars, ... }:
{
## Git
programs.git = {
enable = true;
userName = "${vars.user.realname}";
userEmail = "${vars.user.email}";
extraConfig = {
core.sshCommand = "ssh -i /home/joey/.ssh/${vars.user.username}@${vars.laptop.hostname}";
};
delta.enable = true;
delta.options = {
side-by-side = true;
};
};
}

View File

@ -0,0 +1,31 @@
{ pkgs, vars, ... }:
{
home.stateVersion = "24.05";
home.username = "${vars.user.username}";
home.homeDirectory = "/home/${vars.user.username}";
imports = [
./style.nix
./app/browser/zen.nix
./app/flatpak/flatpak.nix
./app/git/git.nix
./app/games/games.nix
./app/media/media.nix
./app/messaging/discord.nix
./app/obs-studio/obs-studio.nix
./app/bitwarden/bitwarden.nix
./app/sh/sh.nix # Consider splitting out to "terminal", "shell", and "cmd" or similar
./app/vscode/vscode.nix # Consider using a generalized "IDE" or "Editor" folder.
./wm/hyprland/wm.nix
];
# Desktop apps
home.packages = with pkgs; [
git
kdePackages.kdeconnect-kde
];
programs.home-manager = {
enable = true;
};
}

View File

@ -1,8 +1,8 @@
{ pkgs, userSettings, ... }: { pkgs, vars, ... }:
{ {
home.packages = with pkgs; [ base16-schemes ]; home.packages = with pkgs; [ base16-schemes ];
## Stylix ## Stylix
imports = [ ./themes/${userSettings.theme}/theme.nix ]; imports = [ ./themes/${vars.laptop.theme}/theme.nix ];
stylix = { stylix = {
enable = true; enable = true;
autoEnable = true; autoEnable = true;

View File

Before

Width:  |  Height:  |  Size: 9.6 MiB

After

Width:  |  Height:  |  Size: 9.6 MiB

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 208 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@ -1,8 +1,8 @@
{ pkgs, inputs, ... }: { pkgs, vars, ... }:
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./wm/${inputs.vars."joey-laptop".wm}/desktopEnvironment.nix ./wm/${vars.laptop.wm}/desktopEnvironment.nix
./system.nix ./system.nix
./security.nix ./security.nix
./flatpak.nix ./flatpak.nix
@ -13,10 +13,10 @@
# Configure user # Configure user
programs.zsh.enable = true; programs.zsh.enable = true;
users.users.${inputs.vars."joey-laptop".username} = { users.users.${vars.user.username} = {
isNormalUser = true; isNormalUser = true;
shell = pkgs.zsh; shell = pkgs.zsh;
description = "${inputs.vars."joey-laptop".username}"; description = "${vars.user.username}";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [ "networkmanager" "wheel" ];
openssh.authorizedKeys.keys = let openssh.authorizedKeys.keys = let
authorizedKeys = pkgs.fetchurl { authorizedKeys = pkgs.fetchurl {

View File

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }: { pkgs, vars, ... }:
{ {
# Configure system packages # Configure system packages
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@ -21,7 +21,7 @@
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
# Configure networking # Configure networking
networking.hostName = "${inputs.vars."joey-laptop".hostname}"; networking.hostName = "${vars.laptop.hostname}";
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
# Disable systemd's getty and autovt on tty1 # Disable systemd's getty and autovt on tty1

View File

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }: { pkgs, vars, ... }:
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
mako libnotify mako libnotify
@ -18,7 +18,7 @@
services.displayManager = { services.displayManager = {
autoLogin = { autoLogin = {
enable = true; enable = true;
user = "${inputs.vars."joey-laptop".username}"; user = "${vars.user.username}";
}; };
sddm = { sddm = {
enable = true; enable = true;

View File

@ -1,4 +1,4 @@
{ pkgs, lib, inputs, ... }: { pkgs, lib, vars, ... }:
{ {
# Configure displayManager # Configure displayManager
@ -6,7 +6,7 @@
services.displayManager = { services.displayManager = {
enable = true; enable = true;
autoLogin.enable = true; autoLogin.enable = true;
autoLogin.user = "${inputs.vars."joey-laptop".username}"; autoLogin.user = "${vars.user.username}";
sddm = { sddm = {
enable = true; enable = true;
autoNumlock = true; autoNumlock = true;