Refactored configuration

This commit is contained in:
xeovalyte 2024-06-25 13:11:30 +02:00
parent 3ead6d13d8
commit 726b059e5e
Signed by: xeovalyte
SSH Key Fingerprint: SHA256:kSQDrQDmKzljJzfGYcd3m9RqHi4h8rSwkZ3sQ9kBURo
9 changed files with 198 additions and 319 deletions

226
flake.lock generated
View File

@ -16,80 +16,6 @@
"type": "github"
}
},
"firefox-addons": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1717646600,
"narHash": "sha256-yHNeUEOU8/n+ULrsokW5aCLDWg/mEVbPCOyhTIorZns=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "bdbbd8c2cb03b23b586fea14a8a680b218ab363c",
"type": "gitlab"
},
"original": {
"dir": "pkgs/firefox-addons",
"owner": "rycee",
"repo": "nur-expressions",
"type": "gitlab"
}
},
"flake-checks": {
"locked": {
"lastModified": 1716193450,
"narHash": "sha256-wIbyIQRoLAfGe2v8W7LM6zEZ9Oy0jKuUX0HMUCLQJsM=",
"owner": "getchoo",
"repo": "flake-checks",
"rev": "842c3f225677aa55e44b94342f19c8f3e6f2be06",
"type": "github"
},
"original": {
"owner": "getchoo",
"repo": "flake-checks",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1629284811,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c5d161cc0af116a2e17f54316f0bf43f0819785c",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"getchoo": {
"inputs": {
"flake-checks": "flake-checks",
"nixpkgs": [
"nixpkgs-unstable"
]
},
"locked": {
"lastModified": 1717496495,
"narHash": "sha256-tvKpBxQ3u9u221bhKHy7zVQp0Wsdc9b4M3SvC3/1FMs=",
"owner": "getchoo",
"repo": "nix-exprs",
"rev": "0eeabcca8362d37d0563e5315a00d50cae73308a",
"type": "github"
},
"original": {
"owner": "getchoo",
"repo": "nix-exprs",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -111,94 +37,6 @@
"type": "github"
}
},
"hypridle": {
"inputs": {
"hyprlang": "hyprlang",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_2"
},
"locked": {
"lastModified": 1716309977,
"narHash": "sha256-4jDQIcMDSFOOMBxVTEiC6Ck1vdc0kAFvv+StxnnE59Q=",
"owner": "hyprwm",
"repo": "hypridle",
"rev": "cb169c4e06cec9b4349e3668427e729d22328a54",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hypridle",
"type": "github"
}
},
"hyprlang": {
"inputs": {
"nixpkgs": [
"hypridle",
"nixpkgs"
],
"systems": "systems"
},
"locked": {
"lastModified": 1713121246,
"narHash": "sha256-502X0Q0fhN6tJK7iEUA8CghONKSatW/Mqj4Wappd++0=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "78fcaa27ae9e1d782faa3ff06c8ea55ddce63706",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"hyprlang_2": {
"inputs": {
"nixpkgs": [
"hyprlock",
"nixpkgs"
],
"systems": "systems_3"
},
"locked": {
"lastModified": 1713121246,
"narHash": "sha256-502X0Q0fhN6tJK7iEUA8CghONKSatW/Mqj4Wappd++0=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "78fcaa27ae9e1d782faa3ff06c8ea55ddce63706",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"hyprlock": {
"inputs": {
"hyprlang": "hyprlang_2",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_4"
},
"locked": {
"lastModified": 1716987277,
"narHash": "sha256-l8aa+XPDbM3Mf3W4ukC/tBBHVZE8A3att4KLXrnyKSI=",
"owner": "hyprwm",
"repo": "hyprlock",
"rev": "e07d4110dc0b9d1786403aa760232564ad28b6fa",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlock",
"type": "github"
}
},
"nix-colors": {
"inputs": {
"base16-schemes": "base16-schemes",
@ -265,75 +103,11 @@
},
"root": {
"inputs": {
"firefox-addons": "firefox-addons",
"getchoo": "getchoo",
"home-manager": "home-manager",
"hypridle": "hypridle",
"hyprlock": "hyprlock",
"nix-colors": "nix-colors",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
}
},
"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": {
"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": {
"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_4": {
"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"
}
}
},
"root": "root",

View File

@ -12,26 +12,6 @@
};
nix-colors.url = "github:misterio77/nix-colors";
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprlock = {
url = "github:/hyprwm/hyprlock";
inputs.nixpkgs.follows = "nixpkgs";
};
hypridle = {
url = "github:/hyprwm/hypridle";
inputs.nixpkgs.follows = "nixpkgs";
};
getchoo = {
url = "github:getchoo/nix-exprs";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
};
outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, nix-colors, ... }:
@ -56,12 +36,13 @@
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.extraSpecialArgs = { inherit inputs nix-colors ;hostName = "xv-laptop"; };
home-manager.extraSpecialArgs = { inherit inputs nix-colors; };
home-manager.users.xeovalyte.imports = [ ./hosts/laptop/home.nix ];
}
];
};
};
nixosConfigurations = {
xv-desktop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
@ -73,11 +54,32 @@
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.extraSpecialArgs = { inherit inputs nix-colors; hostName = "xv-desktop"; };
home-manager.extraSpecialArgs = { inherit inputs nix-colors; };
home-manager.users.xeovalyte.imports = [ ./hosts/desktop/home.nix ];
}
];
};
};
nixosConfigurations = {
vnix-ctr = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
({ config, pkgs, ... }: {
nixpkgs.overlays = [ overlay-unstable ];
networking.hostName = "vnix-ctn01";
})
./hosts/vnix-ctr
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.extraSpecialArgs = { inherit inputs nix-colors; };
home-manager.users.xeovalyte.imports = [ ./hosts/vnix-ctr/home.nix ];
}
];
};
};
};
}

View File

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, lib, config, ... }:
{
imports = [
@ -13,11 +13,24 @@
../../modules/home/cli/ssh.nix
];
options = {
host = lib.mkOption {
type = with lib.types; str;
description = ''
Define the host of the machine
'';
};
};
config = {
home = {
username = "xeovalyte";
homeDirectory = "/home/xeovalyte";
};
host = "xv-laptop";
home.packages = with pkgs; [
# Desktop Applications
kdenlive
@ -39,4 +52,6 @@
];
home.stateVersion = "24.05";
};
}

View File

@ -0,0 +1,53 @@
{ config, pkgs, ... }:
{
imports = [ # Include the results of the hardware scan.
./hardware-configuration.nix
# CLI
../../modules/system/cli/common.nix
../../modules/system/cli/podman.nix
# Hardware
../../modules/system/hardware/firewall.nix
../../modules/system/hardware/garbage-collection.nix
../../modules/system/hardware/locale.nix
];
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
substituters = [
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
# Bootloader
boot.loader.grub = {
enable = true;
device = "/dev/sda";
useOSProber = true;
};
# Networking
networking.networkmanager.enable = true;
networking.firewall = {
allowedTCPPorts = [ 1080 ];
allowedUDPPorts = [ 53 ];
};
# Configure user
users.users.xeovalyte = {
isNormalUser = true;
description = "Timo Boomers";
extraGroups = [ "networkmanager" "wheel" "dialout" "fuse" ];
};
system.stateVersion = "24.05";
}

20
hosts/vnix-ctr/home.nix Normal file
View File

@ -0,0 +1,20 @@
{ pkgs, ... }:
{
imports = [
# GUI
../../modules/home/gui/theming.nix
# CLI
../../modules/home/cli/common
];
guiTheming.enable = false;
home = {
username = "xeovalyte";
homeDirectory = "/home/xeovalyte";
};
home.stateVersion = "24.05";
}

View File

@ -1,4 +1,4 @@
{ config, pkgs, lib, hostName, ... }:
{ config, pkgs, lib, ... }:
{
imports = [
@ -24,12 +24,10 @@
wayland.windowManager.hyprland = {
enable = true;
settings = {
monitor = if hostName == "xv-laptop" then [
monitor = lib.mkIf (config.host == "xv-laptop") [
"eDP-1,preferred,3840x0,1.333"
"DP-10,preferred,0x0,1"
"DP-9,preferred,1920x0,1"
] else [
",preferred,auto,auto"
];
exec-once = [
@ -81,7 +79,10 @@
force_zero_scaling = true;
};
workspace = if hostName == "xv-desktop" then [
workspace = lib.mkMerge [[
]
(lib.mkIf (config.host == "xv-desktop") [
"1, monitor:DP-2"
"2, monitor:DP-2"
"3, monitor:DP-2"
@ -92,7 +93,8 @@
"8, monitor:HDMI-A-1"
"9, monitor:HDMI-A-1"
"10, monitor:HDMI-A-1"
] else [
])
(lib.mkIf (config.host == "xv-laptop") [
"1, monitor:DP-10"
"2, monitor:DP-10"
"3, monitor:DP-10"
@ -103,7 +105,7 @@
"8, monitor:eDP-1"
"9, monitor:eDP-1"
"10, monitor:eDP-1"
];
])];
bind = [
"$mod, Q, exec, alacritty"
@ -156,19 +158,7 @@
"$mod SHIFT, 8, movetoworkspace, 8"
"$mod SHIFT, 9, movetoworkspace, 9"
"$mod SHIFT, 0, movetoworkspace, 10"
] ++ (if hostName == "xv-desktop" then [
",code:194,workspace, 6"
",code:195,workspace, 7"
",code:196,workspace, 8"
",code:197,workspace, 9"
",code:198,workspace, 10"
"SHIFT, code:194, movetoworkspace, 6"
"SHIFT, code:195, movetoworkspace, 7"
"SHIFT, code:196, movetoworkspace, 8"
"SHIFT, code:197, movetoworkspace, 9"
"SHIFT, code:198, movetoworkspace, 10"
] else [ ]);
];
bindle = [
# Volume control

View File

@ -1,4 +1,4 @@
{ hostName, pkgs, ... }:
{ pkgs, lib, config, ... }:
{
programs.waybar = {
@ -28,14 +28,14 @@
"on-scroll-up" = "hyprctl dispatch workspace e+1";
"on-scroll-down" = "hyprctl dispatch workspace e-1";
"on-click" = "activate";
"persistent-workspaces" = if hostName == "xv-laptop" then {
"persistent-workspaces" = lib.mkMerge [{
}
(lib.mkIf (config.host == "xv-laptop") {
"DP-10" = [ 1 2 3 4 ];
"DP-9" = [ 5 6 7 ];
"eDP-1" = [ 8 9 10 ];
} else {
"DP-2" = [ 1 2 3 4 5 ];
"HDMI-A-1" = [ 6 7 8 9 10 ];
};
})];
"format-icons" = {
"default" = "";
"empty" = "";

View File

@ -5,13 +5,20 @@ let
gtkThemeFromScheme;
in
{
options = {
guiTheming.enable = lib.mkEnableOption "Enable GTK and QT theming";
};
imports = [
nix-colors.homeManagerModules.default
];
config = {
guiTheming.enable = lib.mkDefault true;
colorScheme = nix-colors.colorSchemes.da-one-sea;
gtk = {
gtk = lib.mkIf config.guiTheming.enable {
enable = true;
theme = {
name = "${config.colorScheme.slug}";
@ -23,7 +30,7 @@ in
};
};
qt = {
qt = lib.mkIf config.guiTheming.enable {
enable = true;
platformTheme.name = "gtk";
style = {
@ -32,10 +39,11 @@ in
};
};
home.pointerCursor = {
home.pointerCursor = lib.mkIf config.guiTheming.enable {
package = pkgs.phinger-cursors;
name = "phinger-cursors-dark";
size = 24;
gtk.enable = true;
};
};
}

View File

@ -0,0 +1,17 @@
{ pkgs, ... }:
{
virtualisation.containers.enable = true;
virtualisation.podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
};
environment.systemPackages = with pkgs; [
dive
podman-tui
podman-compose
];
}