diff --git a/assets/wallpaper-2.png b/assets/wallpaper-2.png new file mode 100644 index 0000000..79567f7 Binary files /dev/null and b/assets/wallpaper-2.png differ diff --git a/flake.lock b/flake.lock index 08f0447..89240f5 100644 --- a/flake.lock +++ b/flake.lock @@ -1,25 +1,52 @@ { "nodes": { - "apple-fonts": { + "base16": { "inputs": { - "nixpkgs": "nixpkgs", - "ny": "ny", - "sf-arabic": "sf-arabic", - "sf-compact": "sf-compact", - "sf-mono": "sf-mono", - "sf-pro": "sf-pro" + "fromYaml": "fromYaml" }, "locked": { - "lastModified": 1732029343, - "narHash": "sha256-sAOEhA/vfyAKggwyI3PNy2xeNzb/USZl4YNpeSzMRBI=", - "owner": "lyndeno", - "repo": "apple-fonts.nix", - "rev": "714767021b57d0d30de35eb90e4b748fbbb9c99f", + "lastModified": 1732200724, + "narHash": "sha256-+R1BH5wHhfnycySb7Sy5KbYEaTJZWm1h+LW1OtyhiTs=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "153d52373b0fb2d343592871009a286ec8837aec", "type": "github" }, "original": { - "owner": "lyndeno", - "repo": "apple-fonts.nix", + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1622559957, + "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1725860795, + "narHash": "sha256-Z2o8VBPW3I+KKTSfe25kskz0EUj7MpUh8u355Z1nVsU=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "7f795bf75d38e0eea9fed287264067ca187b88a9", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", "type": "github" } }, @@ -39,6 +66,108 @@ "type": "github" } }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1731949548, + "narHash": "sha256-XIDexXM66sSh5j/x70e054BnUsviibUShW7XhbDGhYo=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "61165b1632409bd55e530f3dbdd4477f011cadc6", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1717312683, + "narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "38fd3954cf65ce6faf3d0d45cd26059e059f07ea", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "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-utils": { + "inputs": { + "systems": [ + "stylix", + "systems" + ] + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1732369855, + "narHash": "sha256-JhUWbcYPjHO3Xs3x9/Z9RuqXbcp5yhPluGjwsdE2GMg=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "dadd58f630eeea41d645ee225a63f719390829dc", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "47.2", + "repo": "gnome-shell", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -46,11 +175,11 @@ ] }, "locked": { - "lastModified": 1732466619, - "narHash": "sha256-T1e5oceypZu3Q8vzICjv1X/sGs9XfJRMW5OuXHgpB3c=", + "lastModified": 1734366194, + "narHash": "sha256-vykpJ1xsdkv0j8WOVXrRFHUAdp9NXHpxdnn1F4pYgSw=", "owner": "nix-community", "repo": "home-manager", - "rev": "f3111f62a23451114433888902a55cf0692b408d", + "rev": "80b0fdf483c5d1cb75aaad909bd390d48673857f", "type": "github" }, "original": { @@ -60,6 +189,27 @@ "type": "github" } }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733085484, + "narHash": "sha256-dVmNuUajnU18oHzBQWZm1BQtANCHaqNuxTHZQ+GN0r8=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "c1fee8d4a60b89cae12b288ba9dbc608ff298163", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "nix-colors": { "inputs": { "base16-schemes": "base16-schemes", @@ -79,17 +229,54 @@ "type": "github" } }, - "nixpkgs": { + "nixos-cosmic": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable", + "rust-overlay": "rust-overlay" + }, "locked": { - "lastModified": 1731319897, - "narHash": "sha256-PbABj4tnbWFMfBp6OcUK5iGy1QY+/Z96ZcLpooIbuEI=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "dc460ec76cbff0e66e269457d7b728432263166c", + "lastModified": 1735263434, + "narHash": "sha256-5Bn1c2sWzedpGV+PNfXtoainQ3uUKkx/v7T3N6lKKms=", + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "rev": "e5fdfe023742172ec0e7af0ca6d88362228d14b7", "type": "github" }, "original": { - "owner": "nixos", + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "type": "github" + } + }, + "nixos-hardware": { + "locked": { + "lastModified": 1734954597, + "narHash": "sha256-QIhd8/0x30gEv8XEE1iAnrdMlKuQ0EzthfDR7Hwl+fk=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "def1d472c832d77885f174089b0d34854b007198", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1734649271, + "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507", + "type": "github" + }, + "original": { + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" @@ -110,13 +297,29 @@ "type": "github" } }, - "nixpkgs-unstable": { + "nixpkgs-stable": { "locked": { - "lastModified": 1732521221, - "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", + "lastModified": 1735141468, + "narHash": "sha256-VIAjBr1qGcEbmhLwQJD6TABppPMggzOvqFsqkDoMsAY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d", + "rev": "4005c3ff7505313cbc21081776ad0ce5dfd7a3ce", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1734649271, + "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507", "type": "github" }, "original": { @@ -127,86 +330,148 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1732350895, - "narHash": "sha256-GcOQbOgmwlsRhpLGSwZJwLbo3pu9ochMETuRSS1xpz4=", + "lastModified": 1732238832, + "narHash": "sha256-sQxuJm8rHY20xq6Ah+GwIUkF95tWjGRd1X8xF+Pkk38=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0c582677378f2d9ffcb01490af2f2c678dcb29d3", + "rev": "8edf06bea5bcbee082df1b7369ff973b91618b8d", "type": "github" }, "original": { - "id": "nixpkgs", - "ref": "nixos-24.11", - "type": "indirect" - } - }, - "ny": { - "flake": false, - "locked": { - "narHash": "sha256-3257NAH4qlan2YHVLpNRy7x8IJqR2pal3OzFo/ykqXs=", - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/NY.dmg" - }, - "original": { - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/NY.dmg" + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" } }, "root": { "inputs": { - "apple-fonts": "apple-fonts", "home-manager": "home-manager", "nix-colors": "nix-colors", + "nixos-cosmic": "nixos-cosmic", + "nixos-hardware": "nixos-hardware", + "nixpkgs": [ + "nixos-cosmic", + "nixpkgs-stable" + ], + "nixpkgs-unstable": "nixpkgs-unstable", + "stylix": "stylix" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixos-cosmic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1735180071, + "narHash": "sha256-ceUDFBsLf5Cz3GlhQAdaJsEfi5s1MDjDsO9VvPFoKAE=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "550e1f10be4a504747a7894c35e887e61235763b", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-helix": "base16-helix", + "base16-vim": "base16-vim", + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils", + "gnome-shell": "gnome-shell", + "home-manager": "home-manager_2", "nixpkgs": "nixpkgs_2", - "nixpkgs-unstable": "nixpkgs-unstable" - } - }, - "sf-arabic": { - "flake": false, + "systems": "systems", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-tmux": "tinted-tmux" + }, "locked": { - "narHash": "sha256-/0gjRimqvZyE60xYxxPdlU+7Q2LJnnvtbmwOP0YmS9U=", - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Arabic.dmg" + "lastModified": 1735253599, + "narHash": "sha256-aKLAUkdeMH2N5gMDNiOC7KghRNy1necLtLa9+zUcj1g=", + "owner": "danth", + "repo": "stylix", + "rev": "963e77a3a4fc2be670d5a9a6cbeb249b8a43808a", + "type": "github" }, "original": { - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Arabic.dmg" + "owner": "danth", + "repo": "stylix", + "type": "github" } }, - "sf-compact": { - "flake": false, + "systems": { "locked": { - "narHash": "sha256-J72Lyt2wy83E46wN8w6/Rih9kilM9wEjtY6KnbF0DsA=", - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg" + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" }, "original": { - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg" + "owner": "nix-systems", + "repo": "default", + "type": "github" } }, - "sf-mono": { + "tinted-foot": { "flake": false, "locked": { - "narHash": "sha256-ICdHRFdNL7PM/fXJUzS7LgZxZiqcyIuCMHLze4En4vg=", - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg" + "lastModified": 1726913040, + "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" }, "original": { - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg" + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" } }, - "sf-pro": { + "tinted-kitty": { "flake": false, "locked": { - "narHash": "sha256-Q/pOQ4MGhW/ZtLka+UUQcwSoZFDWW34XvutxL4GvzUY=", - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg" + "lastModified": 1716423189, + "narHash": "sha256-2xF3sH7UIwegn+2gKzMpFi3pk5DlIlM18+vj17Uf82U=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" }, "original": { - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg" + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1729501581, + "narHash": "sha256-1ohEFMC23elnl39kxWnjzH1l2DFWWx4DhFNNYDTYt54=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "f0e7f7974a6441033eb0a172a0342e96722b4f14", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 196a545..9ec9408 100644 --- a/flake.nix +++ b/flake.nix @@ -11,11 +11,20 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + nix-colors.url = "github:misterio77/nix-colors"; - apple-fonts.url = "github:lyndeno/apple-fonts.nix"; + + stylix.url = "github:danth/stylix"; + + nixpkgs.follows = "nixos-cosmic/nixpkgs-stable"; + + nixos-cosmic = { + url = "github:lilyinstarlight/nixos-cosmic"; + }; }; - outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, nix-colors, apple-fonts, ... }: + outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, nix-colors, stylix, nixos-cosmic, ... }: let system = "x86_64-linux"; overlay-unstable = final: prev: { @@ -34,6 +43,9 @@ modules = [ ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) + inputs.nixos-hardware.nixosModules.framework-13-7040-amd + nixos-cosmic.nixosModules.default + ./hosts/laptop ]; }; @@ -45,12 +57,40 @@ extraSpecialArgs = { inherit inputs nix-colors; }; modules = [ ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) - + ./hosts/laptop/home.nix ]; }; }; + # Surface Configuration + nixosConfigurations = { + xv-surface = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) + + inputs.nixos-hardware.nixosModules.microsoft-surface-go + nixos-cosmic.nixosModules.default + + ./hosts/surface + ]; + }; + }; + + homeConfigurations = { + "xeovalyte@xv-surface" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = { inherit inputs nix-colors; }; + modules = [ + ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) + + ./hosts/surface/home.nix + ]; + }; + }; + nixosConfigurations = { xv-desktop = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index f920bea..3973009 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -1,34 +1,55 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { - imports = [ # Include the results of the hardware scan. + imports = [ + # Include the results of the hardware scan. ./hardware-configuration.nix - # GUI - ../../modules/system/gui/steam.nix - ../../modules/system/gui/hyprland.nix - ../../modules/system/gui/thunar.nix - - # CLI - ../../modules/system/cli/common.nix - ../../modules/system/cli/docker.nix - - # Hardware - ../../modules/system/hardware/firewall.nix - ../../modules/system/hardware/garbage-collection.nix - ../../modules/system/hardware/locale.nix - ../../modules/system/hardware/nvidia.nix + # Import modules + ../../modules/system/default.nix ]; + settings = { + display-manager = "cosmic-greeter"; + desktop-environments = { + cosmic.enable = true; + hyprland.enable = false; + gnome.enable = false; + }; + applications = { + common.enable = true; + steam.enable = true; + thunar.enable = false; + }; + services = { + docker.enable = false; + quickemu.enable = false; + sunshine.enable = false; + garbage-collection.enable = true; + }; + hardware = { + fprint.enable = false; + printing.enable = true; + bluetooth.enable = false; + firewall.enable = true; + locale.enable = true; + nvidia.enable = true; + }; + }; + nix.settings = { experimental-features = [ "nix-command" "flakes" ]; substituters = [ "https://nix-community.cachix.org" + "https://cosmic.cachix.org/" + ]; + + trusted-public-keys = [ + "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ]; }; - # Bootloader. boot.loader.efi.canTouchEfiVariables = true; boot.loader.grub = { @@ -37,6 +58,7 @@ device = "nodev"; }; + # Networking configuration networking.hostName = "xv-desktop"; # Define your hostname. networking.interfaces.enp7s0.wakeOnLan.enable = true; diff --git a/hosts/desktop/home.nix b/hosts/desktop/home.nix index c50f330..70f1c90 100644 --- a/hosts/desktop/home.nix +++ b/hosts/desktop/home.nix @@ -2,16 +2,13 @@ { imports = [ - # GUI - ../../modules/home/gui/common - ../../modules/home/gui/hyprland - ../../modules/home/gui/nextcloud.nix - ../../modules/home/gui/theming.nix - - # CLI - ../../modules/home/cli/common + # Modules + ../../modules/home/default.nix ]; + # Enable home-manager + programs.home-manager.enable = true; + options = { host = lib.mkOption { type = with lib.types; str; @@ -45,6 +42,28 @@ # Enable home-manager programs.home-manager.enable = true; + settings = { + applications.common.enable = true; + applications.alacritty.enable = false; + applications.devenv.enable = true; + applications.firefox.enable = true; + applications.git.enable = true; + applications.helix.enable = true; + applications.zsh.enable = true; + applications.ssh.enable = true; + applications.thunderbird.enable = true; + applications.yazi.enable = true; + applications.zellij.enable = true; + + services.nextcloud-sync.enable = true; + + theming.fonts.enable = true; + theming.nix-colors.enable = false; + theming.stylix.enable = true; + + desktop-environments.hyprland.enable = false; + }; + home.stateVersion = "24.05"; }; } diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index 4a89c17..3efde9a 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -1,36 +1,52 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { imports = [ + # Import hardware configuration ./hardware-configuration.nix - # GUI - ../../modules/system/gui/hyprland.nix - ../../modules/system/gui/steam.nix - ../../modules/system/gui/thunar.nix - # ../../modules/system/gui/plasma.nix - - # CLI - ../../modules/system/cli/common.nix - ../../modules/system/cli/docker.nix - - # Hardware - ../../modules/system/hardware/amd.nix - ../../modules/system/hardware/bluetooth.nix - ../../modules/system/hardware/firewall.nix - ../../modules/system/hardware/garbage-collection.nix - ../../modules/system/hardware/laptop.nix - ../../modules/system/hardware/locale.nix - ../../modules/system/hardware/printing.nix - ../../modules/system/hardware/fprint.nix - ../../modules/system/hardware/virt.nix + # Import modules + ../../modules/system/default.nix ]; + settings = { + display-manager = "cosmic-greeter"; + desktop-environments = { + cosmic.enable = true; + hyprland.enable = true; + gnome.enable = false; + }; + applications = { + common.enable = true; + steam.enable = true; + thunar.enable = true; + }; + services = { + docker.enable = true; + quickemu.enable = true; + sunshine.enable = false; + garbage-collection.enable = true; + }; + hardware = { + fprint.enable = true; + printing.enable = true; + bluetooth.enable = true; + firewall.enable = true; + locale.enable = true; + nvidia.enable = false; + }; + }; + nix.settings = { experimental-features = [ "nix-command" "flakes" ]; substituters = [ "https://nix-community.cachix.org" + "https://cosmic.cachix.org/" + ]; + + trusted-public-keys = [ + "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ]; }; @@ -53,16 +69,12 @@ nix.settings.trusted-users = [ "root" "xeovalyte" ]; - boot.kernelPackages = pkgs.linuxPackages_latest; - - # Configure wacom tablet - hardware.opentabletdriver = { + # Prevent system freeze on high load + services.earlyoom = { enable = true; }; - services.libinput.enable = true; - services.fwupd.enable = true; + boot.kernelPackages = pkgs.linuxPackages_latest; system.stateVersion = "24.05"; - } diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 4fcb058..7073b7d 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -2,21 +2,10 @@ { imports = [ - # GUI - ../../modules/home/gui/common - ../../modules/home/gui/hyprland - ../../modules/home/gui/nextcloud.nix - ../../modules/home/gui/theming.nix - ../../modules/home/gui/thunderbird.nix - - # CLI - ../../modules/home/cli/common - ../../modules/home/cli/develop.nix - ../../modules/home/cli/ssh.nix - ../../modules/home/cli/yazi.nix + # Modules + ../../modules/home/default.nix ]; - options = { host = lib.mkOption { type = with lib.types; str; @@ -42,14 +31,34 @@ host = "xv-laptop"; headless = false; + settings = { + applications.common.enable = true; + applications.alacritty.enable = true; + applications.devenv.enable = true; + applications.firefox.enable = true; + applications.git.enable = true; + applications.helix.enable = true; + applications.zsh.enable = true; + applications.ssh.enable = true; + applications.thunderbird.enable = true; + applications.yazi.enable = true; + applications.zellij.enable = true; + + services.nextcloud-sync.enable = true; + + theming.fonts.enable = true; + theming.nix-colors.enable = false; + theming.stylix.enable = true; + + desktop-environments.hyprland.enable = false; + }; + home.packages = with pkgs; [ # Desktop Applications kdenlive prismlauncher - unstable.modrinth-app unstable.joplin-desktop unstable.prusa-slicer - unstable.font-manager signal-desktop unstable.vesktop unstable.webcord @@ -59,7 +68,6 @@ unstable.rnote unstable.bottles - # Office libreoffice @@ -78,15 +86,6 @@ # Enable home-manager programs.home-manager.enable = true; - # Enable default applications - xdg.mimeApps = { - enable = true; - defaultApplications = { - "application/pdf" = "firefox.desktop"; - "application/rnote" = "rnote.desktop"; - }; - }; - home.stateVersion = "24.05"; }; diff --git a/hosts/surface/default.nix b/hosts/surface/default.nix new file mode 100644 index 0000000..574c1e0 --- /dev/null +++ b/hosts/surface/default.nix @@ -0,0 +1,81 @@ +{ lib, pkgs, ... }: + +{ + imports = [ + # Import hardware configuration + ./hardware-configuration.nix + + # Import modules + ../../modules/system/default.nix + ]; + + settings = { + display-manager = "gdm"; + desktop-environments = { + cosmic.enable = false; + hyprland.enable = false; + gnome.enable = true; + }; + applications = { + common.enable = true; + steam.enable = false; + thunar.enable = false; + }; + services = { + docker.enable = false; + quickemu.enable = false; + sunshine.enable = false; + garbage-collection.enable = true; + }; + hardware = { + fprint.enable = false; + printing.enable = false; + bluetooth.enable = true; + firewall.enable = true; + locale.enable = true; + nvidia.enable = false; + }; + }; + + nix.settings = { + experimental-features = [ "nix-command" "flakes" ]; + + substituters = [ + "https://nix-community.cachix.org" + "https://cosmic.cachix.org/" + ]; + + trusted-public-keys = [ + "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" + ]; + }; + + # Bootloader. + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.grub = { + enable = true; + efiSupport = true; + device = "nodev"; + configurationLimit = 32; + }; + + networking.hostName = "xv-laptop"; # Define your hostname. + + users.users.xeovalyte = { + isNormalUser = true; + description = "Timo Boomers"; + extraGroups = [ "networkmanager" "wheel" "dialout" ]; + }; + + nix.settings.trusted-users = [ "root" "xeovalyte" ]; + + # Prevent system freeze on high load + services.earlyoom = { + enable = true; + }; + + boot.kernelPackages = lib.mkForce pkgs.linuxPackages_latest; + + system.stateVersion = "24.05"; + +} diff --git a/hosts/surface/hardware-configuration.nix b/hosts/surface/hardware-configuration.nix new file mode 100644 index 0000000..620649d --- /dev/null +++ b/hosts/surface/hardware-configuration.nix @@ -0,0 +1,40 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/09e81450-2741-4218-a2e5-780515cd90b9"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/FC00-C9A3"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/30618725-d8ff-40c9-b218-6b1f7aaf9155"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/surface/home.nix b/hosts/surface/home.nix new file mode 100644 index 0000000..982308d --- /dev/null +++ b/hosts/surface/home.nix @@ -0,0 +1,69 @@ +{ pkgs, lib, ... }: + +{ + imports = [ + # Modules + ../../modules/home/default.nix + ]; + + options = { + host = lib.mkOption { + type = with lib.types; str; + description = '' + Define the host of the machine + ''; + }; + + headless = lib.mkOption { + type = with lib.types; bool; + description = '' + Is this machine headless? + ''; + }; + }; + + config = { + home = { + username = "xeovalyte"; + homeDirectory = "/home/xeovalyte"; + }; + + host = "xv-surface"; + headless = false; + + settings = { + applications.common.enable = true; + applications.alacritty.enable = false; + applications.devenv.enable = false; + applications.firefox.enable = true; + applications.git.enable = true; + applications.helix.enable = true; + applications.zsh.enable = true; + applications.ssh.enable = false; + applications.thunderbird.enable = false; + applications.yazi.enable = true; + applications.zellij.enable = false; + + services.nextcloud-sync.enable = true; + + theming.fonts.enable = true; + theming.nix-colors.enable = true; + + desktop-environments.hyprland.enable = false; + }; + + home.packages = with pkgs; [ + # Desktop Applications + unstable.rnote + + # Office + libreoffice + ]; + + # Enable home-manager + programs.home-manager.enable = true; + + home.stateVersion = "24.05"; + }; + +} diff --git a/justfile b/justfile new file mode 100644 index 0000000..455015e --- /dev/null +++ b/justfile @@ -0,0 +1,12 @@ +default: + @just --choose + +rebuild: + sudo nixos-rebuild switch --flake . + home-manager switch --flake . + +rebuild-system: + sudo nixos-rebuild switch --flake . + +rebuild-home-manager: + home-manager switch --flake . diff --git a/modules/home/applications/alacritty.nix b/modules/home/applications/alacritty.nix new file mode 100644 index 0000000..bad770a --- /dev/null +++ b/modules/home/applications/alacritty.nix @@ -0,0 +1,62 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.applications.alacritty; +in { + options = { + settings.applications.alacritty.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable alacritty terimnal + ''; + }; + }; + + config = mkIf cfg.enable { + programs.alacritty = { + enable = true; + settings = { + # font = { + # normal = { family = "DejaVuSansM Nerd Font"; style = "Regular"; }; + # }; + # window = { + # opacity = 0.8; + # padding = { x = 10; y = 10; }; + # }; + # colors = { + # draw_bold_text_with_bright_colors = false; + # primary = { + # background = "0x${config.colorScheme.palette.base00}"; + # foreground = "0x${config.colorScheme.palette.base05}"; + # }; + # cursor = { + # text = "0x${config.colorScheme.palette.base00}"; + # cursor = "0x${config.colorScheme.palette.base05}"; + # }; + # normal = { + # black = "0x${config.colorScheme.palette.base00}"; + # red = "0x${config.colorScheme.palette.base08}"; + # green = "0x${config.colorScheme.palette.base0B}"; + # yellow = "0x${config.colorScheme.palette.base0A}"; + # blue = "0x${config.colorScheme.palette.base0D}"; + # magenta = "0x${config.colorScheme.palette.base0E}"; + # cyan = "0x${config.colorScheme.palette.base0C}"; + # white = "0x${config.colorScheme.palette.base05}"; + # }; + # bright = { + # black = "0x${config.colorScheme.palette.base03}"; + # red = "0x${config.colorScheme.palette.base09}"; + # green = "0x${config.colorScheme.palette.base01}"; + # yellow = "0x${config.colorScheme.palette.base02}"; + # blue = "0x${config.colorScheme.palette.base04}"; + # magenta = "0x${config.colorScheme.palette.base06}"; + # cyan = "0x${config.colorScheme.palette.base0F}"; + # white = "0x${config.colorScheme.palette.base07}"; + # }; + # }; + }; + }; + }; +} diff --git a/modules/home/applications/common.nix b/modules/home/applications/common.nix new file mode 100644 index 0000000..578b3ac --- /dev/null +++ b/modules/home/applications/common.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.settings.applications.common; +in { + options = { + settings.applications.common.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable common applications + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + vlc + bitwarden + pavucontrol + ]; + }; +} diff --git a/modules/home/applications/devenv.nix b/modules/home/applications/devenv.nix new file mode 100644 index 0000000..0b80baa --- /dev/null +++ b/modules/home/applications/devenv.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.settings.applications.devenv; +in { + options = { + settings.applications.devenv.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable common applications + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + unstable.devenv + cloc + ]; + + programs.direnv = { + enable = true; + enableBashIntegration = true; + }; + }; +} + diff --git a/modules/home/applications/firefox.nix b/modules/home/applications/firefox.nix new file mode 100644 index 0000000..42426c9 --- /dev/null +++ b/modules/home/applications/firefox.nix @@ -0,0 +1,171 @@ +{ config, lib, pkgs, ... }: + +# about:policies +# Check about:support for extension/add-on ID strings. +# Check about:config for options. + +with lib; + +let + cfg = config.settings.applications.firefox; +in { + options = { + settings.applications.firefox.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable firefox + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + unstable.firefoxpwa + ]; + + programs.firefox = { + enable = true; + nativeMessagingHosts = [ pkgs.unstable.firefoxpwa ]; + policies = { + DisableTelemetry = true; + DisableFirefoxStudies = true; + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableAccounts = true; + DontCheckDefaultBrowser = true; + DisplayBookmarksToolbar = "newpage"; + ExtensionSettings = { + "nl-NL@dictionaries.addons.mozilla.org" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/woordenboek-nederlands/latest.xpi"; + installation_mode = "force_installed"; + }; + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "force_installed"; + }; + "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi"; + installation_mode = "force_installed"; + }; + "firefoxpwa@filips.si" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/pwas-for-firefox/latest.xpi"; + installation_mode = "force_installed"; + }; + "markdown-viewer@outofindex.com" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/markdown-viewer-chrome/latest.xpi"; + installation_mode = "force_installed"; + }; + }; + }; + profiles.xeovalyte = { + bookmarks = [ + { + name = "Toolbar"; + toolbar = true; + bookmarks = [ + { + name = "Brightspace"; + bookmarks = [ + { + name = "Books"; + url = "https://drive.google.com/drive/folders/1L5OTbn5p3i7_Nc80hc5PztiEGHKwi-I4"; + } + { + name = "LCB"; + url = "https://brightspace.tudelft.nl/d2l/le/content/681010/Home"; + } + { + name = "Calculus"; + url = "https://brightspace.tudelft.nl/d2l/le/content/681024/Home"; + } + { + name = "IP1"; + url = "https://brightspace.tudelft.nl/d2l/le/content/681020/Home"; + } + ]; + } + ]; + } + ]; + search.engines = { + "Nix" = { + urls = [{ + template = "https://mynixos.com/search"; + params = [ + { name = "q"; value = "{searchTerms}"; } + ]; + }]; + + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@nix" ]; + }; + + "SearXNG" = { + urls = [{ + template = "https:/search.xeovalyte.dev/search"; + params = [ + { name = "q"; value = "{searchTerms}"; } + ]; + }]; + + definedAliases = [ "@searxng" ]; + }; + + "Startpage" = { + urls = [{ + template = "https:/startpage.com/sp/search"; + params = [ + { name = "q"; value = "{searchTerms}"; } + ]; + }]; + + definedAliases = [ "@sp" ]; + }; + + "Bing".metaData.hidden = true; + "Google".metaData.hidden = true; + "eBay".metaData.hidden = true; + }; + search.force = true; + search.default = "SearXNG"; + + settings = { + "browser.disableResetPrompt" = true; + "browser.download.panel.shown" = true; + "browser.download.useDownloadDir" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.shell.checkDefaultBrowser" = false; + "browser.shell.defaultBrowserCheckCount" = 1; + "dom.security.https_only_mode" = true; + "privacy.trackingProtection.enabled" = true; + "browser.toolbars.bookmarks.visibility" = "newtab"; + "browser.translations.neverTranslateLanguages" = "nl"; + "browser.newtabpage.pinned" = [ + { + label = "Server"; + url = "https://home.xeovalyte.dev"; + } + { + label = "Youtube"; + url = "https://youtube.com"; + } + { + label = "My TU Delft"; + url = "https://my.tudelft.nl/"; + } + ]; + "signon.rememberSignons" = false; + }; + }; + }; + }; +} + + + diff --git a/modules/home/applications/git.nix b/modules/home/applications/git.nix new file mode 100644 index 0000000..a82eeaa --- /dev/null +++ b/modules/home/applications/git.nix @@ -0,0 +1,46 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.applications.git; +in { + options = { + settings.applications.git.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable git version control + ''; + }; + + settings.applications.git.lazygit.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable lazygit + ''; + default = true; + }; + }; + + config = mkIf cfg.enable { + programs.lazygit = { + enable = true; + settings = { + services = { + "gitea.xeovalyte.dev" = "gitea:gitea.xeovalyte.dev"; + }; + }; + }; + + programs.git = mkIf cfg.lazygit.enable { + enable = true; + userEmail = "me+gitea@xeovalyte.dev"; + userName = "xeovalyte"; + extraConfig = { + commit.gpgsign = true; + gpg.format = "ssh"; + user.signingkey = "~/.ssh/gitea.pub"; + }; + }; + }; +} diff --git a/modules/home/applications/helix.nix b/modules/home/applications/helix.nix new file mode 100644 index 0000000..e322652 --- /dev/null +++ b/modules/home/applications/helix.nix @@ -0,0 +1,218 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.settings.applications.helix; +in { + options = { + settings.applications.helix.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable helix text editor + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + unstable.marksman + unstable.markdown-oxide + unstable.svls + unstable.nil + unstable.nixpkgs-fmt + unstable.tectonic + unstable.texlab + dprint + ]; + + home.file.".config/.dprint.json".text ='' + { + "markdown": { + "lineWidth":120, + }, + "excludes": [], + "plugins": [ + "https://plugins.dprint.dev/markdown-0.16.1.wasm" + ] + } + ''; + + programs.helix = { + enable = true; + package = pkgs.unstable.helix; + defaultEditor = true; + settings = { + # theme = "base16"; + editor.cursor-shape = { + insert = "bar"; + }; + }; + languages = { + # Rust + language-server.rust-analyzer.config = { + cargo = { + features = "all"; + }; + }; + + # Systemverilog + language-server.svls = { + command = "svls"; + }; + + language-server.texlab = { + config = { + texlab.chktex = { + onOpenAndSave = true; + onEdit = true; + }; + texlab.forwardSearch = { + executable = "zathura"; + args = [ + "--synctex-forward" + "%l:%c:%f" + "%p" + ]; + }; + texlab.build = { + auxDirectory = "build"; + logDirectory = "build"; + pdfDirectory = "build"; + forwardSearchAfter = true; + onSave = true; + executable = "tectonic"; + args = [ + "-X" + "compile" + "--synctex" + "--keep-logs" + "--keep-intermediates" + "--outdir=build" + "%f" + ]; + }; + }; + }; + + language = [ + { + name = "verilog"; + language-servers = [ "svls" ]; + } + { + name = "html"; + language-servers = [ "vscode-html-language-server" "tailwindcss-ls" ]; + } + { + name = "css"; + language-servers = [ "vscode-html-language-server" "tailwindcss-ls" ]; + } + { + name = "markdown"; + auto-format = true; + language-servers = [ "markdown-oxide" ]; + formatter.command = "dprint"; + formatter.args = ["fmt" "--stdin" "md" "--config" "/home/xeovalyte/.config/.dprint.json"]; + } + { + name = "typst"; + auto-format = false; + formatter.command = "${pkgs.typstfmt}/bin/typstfmt"; + } + ]; + }; + # themes = { + # base16 = let + # base00 = "#${config.colorScheme.palette.base00}"; + # base01 = "#${config.colorScheme.palette.base01}"; + # base02 = "#${config.colorScheme.palette.base02}"; + # base03 = "#${config.colorScheme.palette.base03}"; + # base04 = "#${config.colorScheme.palette.base04}"; + # base05 = "#${config.colorScheme.palette.base05}"; + # base06 = "#${config.colorScheme.palette.base06}"; + # base07 = "#${config.colorScheme.palette.base07}"; + # base08 = "#${config.colorScheme.palette.base08}"; + # base09 = "#${config.colorScheme.palette.base09}"; + # base0A = "#${config.colorScheme.palette.base0A}"; + # base0B = "#${config.colorScheme.palette.base0B}"; + # base0C = "#${config.colorScheme.palette.base0C}"; + # base0D = "#${config.colorScheme.palette.base0D}"; + # base0E = "#${config.colorScheme.palette.base0E}"; + # base0F = "#${config.colorScheme.palette.base0F}"; + # in { + # "attributes" = base09; + # "comment" = { fg = base03; modifiers = ["italic"]; }; + # "constant" = base09; + # "constant.character.escape" = base0C; + # "constant.numeric" = base09; + # "constructor" = base0D; + # "debug" = base03; + # "diagnostic" = { modifiers = ["underlined"]; }; + # "diff.delta" = base09; + # "diff.minus" = base08; + # "diff.plus" = base0B; + # "error" = base08; + # "function" = base0D; + # "hint" = base03; + # "info" = base0D; + # "keyword" = base0E; + # "label" = base0E; + # "namespace" = base0E; + # "operator" = base05; + # "special" = base0D; + # "string" = base0B; + # "type" = base0A; + # "variable" = base08; + # "variable.other.member" = base0B; + # "warning" = base09; + + # "markup.bold" = { fg = base0A; modifiers = ["bold"]; }; + # "markup.heading" = base0D; + # "markup.italic" = { fg = base0E; modifiers = ["italic"]; }; + # "markup.link.text" = base08; + # "markup.link.url" = { fg = base09; modifiers = ["underlined"]; }; + # "markup.list" = base08; + # "markup.quote" = base0C; + # "markup.raw" = base0B; + # "markup.strikethrough" = { modifiers = ["crossed_out"]; }; + + # "diagnostic.hint" = { underline = { style = "curl"; }; }; + # "diagnostic.info" = { underline = { style = "curl"; }; }; + # "diagnostic.warning" = { underline = { style = "curl"; }; }; + # "diagnostic.error" = { underline = { style = "curl"; }; }; + + # # "ui.background" = { bg = base00; }; + # "ui.bufferline.active" = { fg = base00; bg = base03; modifiers = ["bold"]; }; + # "ui.bufferline" = { fg = base04; bg = base00; }; + # "ui.cursor" = { fg = base0A; modifiers = ["reversed"]; }; + # "ui.cursor.insert" = { fg = base0A; modifiers = ["reversed"]; }; + # "ui.cursorline.primary" = { fg = base05; bg = base01; }; + # "ui.cursor.match" = { fg = base0A; modifiers = ["reversed"]; }; + # "ui.cursor.select" = { fg = base0A; modifiers = ["reversed"]; }; + # "ui.gutter" = { bg = base00; }; + # "ui.help" = { fg = base06; bg = base01; }; + # "ui.linenr" = { fg = base03; bg = base00; }; + # "ui.linenr.selected" = { fg = base04; bg = base01; modifiers = ["bold"]; }; + # "ui.menu" = { fg = base05; bg = base01; }; + # "ui.menu.scroll" = { fg = base03; bg = base01; }; + # "ui.menu.selected" = { fg = base01; bg = base04; }; + # "ui.popup" = { bg = base01; }; + # "ui.selection" = { bg = base02; }; + # "ui.selection.primary" = { bg = base02; }; + # "ui.statusline" = { fg = base04; bg = base01; }; + # "ui.statusline.inactive" = { bg = base01; fg = base03; }; + # "ui.statusline.insert" = { fg = base00; bg = base0B; }; + # "ui.statusline.normal" = { fg = base00; bg = base03; }; + # "ui.statusline.select" = { fg = base00; bg = base0F; }; + # "ui.text" = base05; + # "ui.text.focus" = base05; + # "ui.virtual.indent-guide" = { fg = base03; }; + # "ui.virtual.inlay-hint" = { fg = base01; }; + # "ui.virtual.ruler" = { bg = base01; }; + # "ui.window" = { bg = base01; }; + # }; + # }; + }; + }; +} diff --git a/modules/home/applications/ssh.nix b/modules/home/applications/ssh.nix new file mode 100644 index 0000000..031be8f --- /dev/null +++ b/modules/home/applications/ssh.nix @@ -0,0 +1,37 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.applications.ssh; +in { + options = { + settings.applications.ssh.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable ssh and configure some endpoints + ''; + }; + }; + + config = mkIf cfg.enable { + programs.ssh = { + enable = true; + matchBlocks = { + archserver = { + hostname = "192.168.1.20"; + user = "xeovalyte"; + identityFile = "~/.ssh/archserver"; + }; + + "gitea.xeovalyte.dev" = { + hostname = "gitea.xeovalyte.dev"; + port = 2222; + user = "git"; + identityFile = "~/.ssh/gitea"; + }; + }; + addKeysToAgent = "yes"; + }; + }; +} diff --git a/modules/home/applications/thunderbird.nix b/modules/home/applications/thunderbird.nix new file mode 100644 index 0000000..34cfe55 --- /dev/null +++ b/modules/home/applications/thunderbird.nix @@ -0,0 +1,101 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.settings.applications.thunderbird; +in { + options = { + settings.applications.thunderbird.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable thunderbird mail + ''; + }; + }; + + config = mkIf cfg.enable { + programs.thunderbird = { + enable = true; + package = pkgs.unstable.thunderbird; + profiles = { + default = { + isDefault = true; + }; + }; + }; + + accounts.email.accounts = { + ziggo = { + imap = { + host = "imap.ziggo.nl"; + port = 993; + tls = { + enable = true; + }; + }; + smtp = { + host = "smtp.ziggo.nl"; + port = 587; + tls = { + enable = true; + useStartTls = true; + }; + }; + address = "timo.boomers@ziggo.nl"; + realName = "Timo Boomers"; + userName = "timo.boomers@ziggo.nl"; + primary = true; + thunderbird.enable = true; + thunderbird.profiles = [ "default" ]; + }; + tudelft = { + imap = { + host = "outlook.office365.com"; + port = 993; + tls = { + enable = true; + }; + }; + smtp = { + host = "smtp.office365.com"; + port = 587; + tls = { + enable = true; + useStartTls = false; + }; + }; + address = "tboomers@tudelft.nl"; + realName = "Timo Boomers"; + userName = "tboomers@tudelft.nl"; + primary = false; + thunderbird.enable = true; + thunderbird.profiles = [ "default" ]; + }; + xeovalyte = { + imap = { + host = "mail.xeovalyte.dev"; + port = 993; + tls = { + enable = true; + }; + }; + smtp = { + host = "mail.xeovalyte.dev"; + port = 587; + tls = { + enable = true; + useStartTls = true; + }; + }; + address = "timo@xeovalyte.dev"; + aliases = [ "me@xeovalyte.dev" "contact@xeovalyte.dev" ]; + realName = "Timo Boomers"; + userName = "me@xeovalyte.dev"; + primary = false; + thunderbird.enable = true; + thunderbird.profiles = [ "default" ]; + }; + }; + }; +} diff --git a/modules/home/applications/yazi.nix b/modules/home/applications/yazi.nix new file mode 100644 index 0000000..62b14f5 --- /dev/null +++ b/modules/home/applications/yazi.nix @@ -0,0 +1,35 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.applications.yazi; +in { + options = { + settings.applications.yazi.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable yazi terminal file manager + ''; + }; + }; + + config = mkIf cfg.enable { + programs.yazi = { + enable = true; + enableZshIntegration = true; + settings = { + opener = { + open = [ + { run = "xdg-open $@"; desc = "xdg"; orphan = true; } + ]; + }; + open = { + prepend_rules = [ + { name = "*.rnote"; use = "open"; } + ]; + }; + }; + }; + }; +} diff --git a/modules/home/applications/zellij.nix b/modules/home/applications/zellij.nix new file mode 100644 index 0000000..e7c68f9 --- /dev/null +++ b/modules/home/applications/zellij.nix @@ -0,0 +1,92 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.applications.zellij; +in { + options = { + settings.applications.zellij.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable zellij tool + ''; + }; + }; + + config = mkIf cfg.enable { + programs.zellij = { + enable = true; + }; + + home.file.zellij = { + target = ".config/zellij/config.kdl"; + text = '' + pane_frames false + keybinds { + normal { + bind "Ctrl e" { ToggleFloatingPanes; SwitchToMode "normal"; } + bind "Alt 1" { GoToTab 1; } + bind "Alt 2" { GoToTab 2; } + bind "Alt 3" { GoToTab 3; } + bind "Alt 4" { GoToTab 4; } + bind "Alt 5" { GoToTab 5; } + } + } + ''; + }; + + home.file.zellij-layout-default = { + target = ".config/zellij/layouts/default.kdl"; + text = '' + layout { + pane + floating_panes { + pane { + width "80%" + height "80%" + x "10%" + y "10%" + } + } + } + ''; + }; + + home.file.zellij-layout-dioxus = { + target = ".config/zellij/layouts/dioxus.kdl"; + text = '' + layout { + tab { + pane { + command "hx" + args "." + focus true + } + floating_panes { + pane { + width "80%" + height "80%" + x "10%" + y "10%" + } + } + } + tab { + pane { + command "dx" + args "serve" + } + } + tab { + pane { + command "devenv" + args "up" + } + } + } + ''; + }; + }; +} + diff --git a/modules/home/applications/zsh.nix b/modules/home/applications/zsh.nix new file mode 100644 index 0000000..40fe514 --- /dev/null +++ b/modules/home/applications/zsh.nix @@ -0,0 +1,49 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.settings.applications.zsh; +in { + options = { + settings.applications.zsh.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable zsh shell + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + eza + bat + ]; + + home.shellAliases = { + ls = "eza"; + }; + + programs.bash = { + enable = false; + }; + + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + }; + + programs.starship = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + }; + + programs.skim = { + enable = true; + enableZshIntegration = true; + }; + }; +} diff --git a/modules/home/cli/common/default.nix b/modules/home/cli/common/default.nix deleted file mode 100644 index eb3022d..0000000 --- a/modules/home/cli/common/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: - -{ - imports = [ - ./git.nix - ./shell.nix - ./helix.nix - ]; -} diff --git a/modules/home/cli/common/git.nix b/modules/home/cli/common/git.nix deleted file mode 100644 index 5b1716b..0000000 --- a/modules/home/cli/common/git.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ pkgs, ... }: - -{ - programs.lazygit = { - enable = true; - settings = { - services = { - "gitea.xeovalyte.dev" = "gitea:gitea.xeovalyte.dev"; - }; - }; - }; - - programs.git = { - enable = true; - userEmail = "me+gitea@xeovalyte.dev"; - userName = "xeovalyte"; - extraConfig = { - commit.gpgsign = true; - gpg.format = "ssh"; - user.signingkey = "~/.ssh/gitea.pub"; - }; - }; -} diff --git a/modules/home/cli/common/helix.nix b/modules/home/cli/common/helix.nix deleted file mode 100644 index 09dfc54..0000000 --- a/modules/home/cli/common/helix.nix +++ /dev/null @@ -1,203 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ - unstable.marksman - unstable.markdown-oxide - unstable.svls - unstable.nil - unstable.nixpkgs-fmt - unstable.tectonic - unstable.texlab - dprint - ]; - - home.file.".config/.dprint.json".text ='' - { - "markdown": { - "lineWidth":120, - }, - "excludes": [], - "plugins": [ - "https://plugins.dprint.dev/markdown-0.16.1.wasm" - ] - } - ''; - - programs.helix = { - enable = true; - package = pkgs.unstable.helix; - defaultEditor = true; - settings = { - theme = "base16"; - editor.cursor-shape = { - insert = "bar"; - }; - }; - languages = { - # Rust - language-server.rust-analyzer.config = { - cargo = { - features = "all"; - }; - }; - - # Systemverilog - language-server.svls = { - command = "svls"; - }; - - language-server.texlab = { - config = { - texlab.chktex = { - onOpenAndSave = true; - onEdit = true; - }; - texlab.forwardSearch = { - executable = "zathura"; - args = [ - "--synctex-forward" - "%l:%c:%f" - "%p" - ]; - }; - texlab.build = { - auxDirectory = "build"; - logDirectory = "build"; - pdfDirectory = "build"; - forwardSearchAfter = true; - onSave = true; - executable = "tectonic"; - args = [ - "-X" - "compile" - "--synctex" - "--keep-logs" - "--keep-intermediates" - "--outdir=build" - "%f" - ]; - }; - }; - }; - - language = [ - { - name = "verilog"; - language-servers = [ "svls" ]; - } - { - name = "html"; - language-servers = [ "vscode-html-language-server" "tailwindcss-ls" ]; - } - { - name = "css"; - language-servers = [ "vscode-html-language-server" "tailwindcss-ls" ]; - } - { - name = "markdown"; - auto-format = true; - language-servers = [ "markdown-oxide" ]; - formatter.command = "dprint"; - formatter.args = ["fmt" "--stdin" "md" "--config" "/home/xeovalyte/.config/.dprint.json"]; - } - { - name = "typst"; - auto-format = false; - formatter.command = "${pkgs.typstfmt}/bin/typstfmt"; - } - ]; - }; - themes = { - base16 = let - base00 = "#${config.colorScheme.palette.base00}"; - base01 = "#${config.colorScheme.palette.base01}"; - base02 = "#${config.colorScheme.palette.base02}"; - base03 = "#${config.colorScheme.palette.base03}"; - base04 = "#${config.colorScheme.palette.base04}"; - base05 = "#${config.colorScheme.palette.base05}"; - base06 = "#${config.colorScheme.palette.base06}"; - base07 = "#${config.colorScheme.palette.base07}"; - base08 = "#${config.colorScheme.palette.base08}"; - base09 = "#${config.colorScheme.palette.base09}"; - base0A = "#${config.colorScheme.palette.base0A}"; - base0B = "#${config.colorScheme.palette.base0B}"; - base0C = "#${config.colorScheme.palette.base0C}"; - base0D = "#${config.colorScheme.palette.base0D}"; - base0E = "#${config.colorScheme.palette.base0E}"; - base0F = "#${config.colorScheme.palette.base0F}"; - in { - "attributes" = base09; - "comment" = { fg = base03; modifiers = ["italic"]; }; - "constant" = base09; - "constant.character.escape" = base0C; - "constant.numeric" = base09; - "constructor" = base0D; - "debug" = base03; - "diagnostic" = { modifiers = ["underlined"]; }; - "diff.delta" = base09; - "diff.minus" = base08; - "diff.plus" = base0B; - "error" = base08; - "function" = base0D; - "hint" = base03; - "info" = base0D; - "keyword" = base0E; - "label" = base0E; - "namespace" = base0E; - "operator" = base05; - "special" = base0D; - "string" = base0B; - "type" = base0A; - "variable" = base08; - "variable.other.member" = base0B; - "warning" = base09; - - "markup.bold" = { fg = base0A; modifiers = ["bold"]; }; - "markup.heading" = base0D; - "markup.italic" = { fg = base0E; modifiers = ["italic"]; }; - "markup.link.text" = base08; - "markup.link.url" = { fg = base09; modifiers = ["underlined"]; }; - "markup.list" = base08; - "markup.quote" = base0C; - "markup.raw" = base0B; - "markup.strikethrough" = { modifiers = ["crossed_out"]; }; - - "diagnostic.hint" = { underline = { style = "curl"; }; }; - "diagnostic.info" = { underline = { style = "curl"; }; }; - "diagnostic.warning" = { underline = { style = "curl"; }; }; - "diagnostic.error" = { underline = { style = "curl"; }; }; - -# "ui.background" = { bg = base00; }; - "ui.bufferline.active" = { fg = base00; bg = base03; modifiers = ["bold"]; }; - "ui.bufferline" = { fg = base04; bg = base00; }; - "ui.cursor" = { fg = base0A; modifiers = ["reversed"]; }; - "ui.cursor.insert" = { fg = base0A; modifiers = ["reversed"]; }; - "ui.cursorline.primary" = { fg = base05; bg = base01; }; - "ui.cursor.match" = { fg = base0A; modifiers = ["reversed"]; }; - "ui.cursor.select" = { fg = base0A; modifiers = ["reversed"]; }; - "ui.gutter" = { bg = base00; }; - "ui.help" = { fg = base06; bg = base01; }; - "ui.linenr" = { fg = base03; bg = base00; }; - "ui.linenr.selected" = { fg = base04; bg = base01; modifiers = ["bold"]; }; - "ui.menu" = { fg = base05; bg = base01; }; - "ui.menu.scroll" = { fg = base03; bg = base01; }; - "ui.menu.selected" = { fg = base01; bg = base04; }; - "ui.popup" = { bg = base01; }; - "ui.selection" = { bg = base02; }; - "ui.selection.primary" = { bg = base02; }; - "ui.statusline" = { fg = base04; bg = base01; }; - "ui.statusline.inactive" = { bg = base01; fg = base03; }; - "ui.statusline.insert" = { fg = base00; bg = base0B; }; - "ui.statusline.normal" = { fg = base00; bg = base03; }; - "ui.statusline.select" = { fg = base00; bg = base0F; }; - "ui.text" = base05; - "ui.text.focus" = base05; - "ui.virtual.indent-guide" = { fg = base03; }; - "ui.virtual.inlay-hint" = { fg = base01; }; - "ui.virtual.ruler" = { bg = base01; }; - "ui.window" = { bg = base01; }; - }; - }; - }; -} diff --git a/modules/home/cli/common/shell.nix b/modules/home/cli/common/shell.nix deleted file mode 100644 index 01a7aab..0000000 --- a/modules/home/cli/common/shell.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ pkgs, ... }: - -{ - home.packages = with pkgs; [ - eza - bat - ]; - - home.shellAliases = { - ls = "eza"; - }; - - programs.bash = { - enable = false; - }; - - programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - }; - - programs.starship = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - }; -} diff --git a/modules/home/cli/develop.nix b/modules/home/cli/develop.nix deleted file mode 100644 index 2a05eb4..0000000 --- a/modules/home/cli/develop.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ pkgs, ... }: - -{ - home.packages = with pkgs; [ - unstable.devenv - cloc - ]; - - programs.direnv = { - enable = true; - enableBashIntegration = true; - }; - - programs.zellij = { - enable = true; - # enableBashIntegration = true; - }; - - home.file.zellij = { - target = ".config/zellij/config.kdl"; - text = '' - pane_frames false - keybinds { - normal { - bind "Ctrl e" { ToggleFloatingPanes; SwitchToMode "normal"; } - bind "Ctrl 1" { GoToTab 1; } - bind "Ctrl 2" { GoToTab 2; } - bind "Ctrl 3" { GoToTab 3; } - bind "Ctrl 4" { GoToTab 4; } - bind "Ctrl 5" { GoToTab 5; } - } - } - ''; - }; - - home.file.zellij-layout-default = { - target = ".config/zellij/layouts/default.kdl"; - text = '' - layout { - pane - floating_panes { - pane { - width "80%" - height "80%" - x "10%" - y "10%" - } - } - } - ''; - }; - - home.file.zellij-layout-dioxus = { - target = ".config/zellij/layouts/dioxus.kdl"; - text = '' - layout { - tab { - pane { - command "hx" - args "." - focus true - } - floating_panes { - pane { - width "80%" - height "80%" - x "10%" - y "10%" - } - } - } - tab { - pane { - command "dx" - args "serve" - } - } - tab { - pane { - command "devenv" - args "up" - } - } - } - ''; - }; -} diff --git a/modules/home/cli/neovim/autocmd.lua b/modules/home/cli/neovim/autocmd.lua deleted file mode 100644 index 4cbef5b..0000000 --- a/modules/home/cli/neovim/autocmd.lua +++ /dev/null @@ -1,24 +0,0 @@ -local api = vim.api - -api.nvim_create_autocmd( - "FileType", - { pattern = "markdown", command = "setlocal spell" } -) - -api.nvim_create_autocmd( - "FileType", - { pattern = "markdown", command = "setlocal complete+=kspell" } -) - -api.nvim_create_autocmd({ - "BufNewFile", "BufRead" - }, - { pattern = "*.mcfunction", command = "set filetype=mcfunction" } -) - -api.nvim_create_autocmd({ - - "VimEnter" - }, - { callback = require('lualine').setup } -) diff --git a/modules/home/cli/neovim/colorscheme.lua b/modules/home/cli/neovim/colorscheme.lua deleted file mode 100644 index bf480e1..0000000 --- a/modules/home/cli/neovim/colorscheme.lua +++ /dev/null @@ -1,4 +0,0 @@ -require('onedark').setup { - style = 'deep' -} -require('onedark').load() diff --git a/modules/home/cli/neovim/default.nix b/modules/home/cli/neovim/default.nix deleted file mode 100644 index ef1e840..0000000 --- a/modules/home/cli/neovim/default.nix +++ /dev/null @@ -1,132 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: { - home.packages = with pkgs; [ - ripgrep - marksman - wl-clipboard - nodejs_20 - ]; - - programs.neovim = - let - toLua = str: "lua << EOF\n${str}\nEOF\n"; - toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n"; - in - { - enable = true; - coc = { - enable = false; - settings = { - languageserver = { - arduino = { - command = ["steam-run" "arduino-language-server"]; - rootPatterns = ["*.ino"]; - filetypes = ["arduino"]; - args = ["-cli" "steam-run" "arduino-cli" "-clangd" "steam-run" "clangd" "-cli-config" "/home/xeovalyte/.arduino15/arduino-cli.yaml"]; - }; - }; - }; - }; - - viAlias = true; - vimAlias = true; - vimdiffAlias = true; - - extraLuaConfig = '' - ${builtins.readFile ./options.lua} - ${builtins.readFile ./keymaps.lua} - ${builtins.readFile ./autocmd.lua} - ''; - - plugins = with pkgs.vimPlugins; [ - nvim-web-devicons - - { - plugin = nvim-autopairs; - config = toLua "require(\"nvim-autopairs\").setup{}"; - } - - { - plugin = telescope-nvim; - } - plenary-nvim - - { - plugin = nvim-lspconfig; - config = toLuaFile ./plugins/lsp.lua; - } - neodev-nvim - mason-nvim - mason-lspconfig-nvim - which-key-nvim - rustaceanvim - lsp-inlayhints-nvim - nvim-dap - - { - plugin = markdown-preview-nvim; - config = toLuaFile ./plugins/markdown-preview.lua; - } - - { - plugin = nvim-cmp; - config = toLuaFile ./plugins/cmp.lua; - } - cmp_luasnip - cmp-nvim-lsp - luasnip - friendly-snippets - - { - plugin = nvim-tree-lua; - config = toLuaFile ./plugins/nvim-tree.lua; - } - - { - plugin = toggleterm-nvim; - config = toLuaFile ./plugins/toggleterm.lua; - } - - { - plugin = (nvim-treesitter.withPlugins (p: [ - p.tree-sitter-nix - p.tree-sitter-bash - p.tree-sitter-json - p.tree-sitter-rust - p.tree-sitter-vue - p.tree-sitter-arduino - p.tree-sitter-html - p.tree-sitter-css - p.tree-sitter-javascript - ])); - config = toLuaFile ./plugins/treesitter.lua; - } - - { - plugin = onedark-nvim; - config = toLuaFile ./colorscheme.lua; - } - - { - plugin = presence-nvim; - config = toLua "require(\"presence\").setup()"; - } - - { - plugin = lualine-nvim; - config = toLuaFile ./plugins/lualine.lua; - } - - { - plugin =harpoon; - config = toLuaFile ./plugins/harpoon.lua; - } - ]; - }; -} diff --git a/modules/home/cli/neovim/keymaps.lua b/modules/home/cli/neovim/keymaps.lua deleted file mode 100644 index 6ee9be0..0000000 --- a/modules/home/cli/neovim/keymaps.lua +++ /dev/null @@ -1,90 +0,0 @@ -local function map(mode, lhs, rhs, opts) - opts = opts or {} - opts.silent = opts.silent ~= false - if opts.remap and not vim.g.vscode then - opts.remap = nil - end - vim.keymap.set(mode, lhs, rhs, opts) -end - --- better up/down -map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) -map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) - --- Move to window using the hjkl keys -map("n", "", "h", { desc = "Go to left window", remap = true }) -map("n", "", "j", { desc = "Go to lower window", remap = true }) -map("n", "", "k", { desc = "Go to upper window", remap = true }) -map("n", "", "l", { desc = "Go to right window", remap = true }) - --- Resize window using arrow keys -map("n", "", "resize +2", { desc = "Increase window height" }) -map("n", "", "resize -2", { desc = "Decrease window height" }) -map("n", "", "vertical resize -2", { desc = "Decrease window width" }) -map("n", "", "vertical resize +2", { desc = "Increase window width" }) - --- Move Lines -map("n", "", "m .+1==", { desc = "Move down" }) -map("n", "", "m .-2==", { desc = "Move up" }) -map("i", "", "m .+1==gi", { desc = "Move down" }) -map("i", "", "m .-2==gi", { desc = "Move up" }) -map("v", "", ":m '>+1gv=gv", { desc = "Move down" }) -map("v", "", ":m '<-2gv=gv", { desc = "Move up" }) - --- Clear search with -map({ "i", "n" }, "", "noh", { desc = "Escape and clear hlsearch" }) - --- Clear search, diff update and redraw --- taken from runtime/lua/_editor.lua -map( - "n", - "ur", - "nohlsearchdiffupdatenormal! ", - { desc = "Redraw / clear hlsearch / diff update" } -) - --- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n -map("n", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) -map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) -map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) -map("n", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" }) -map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" }) -map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" }) - --- Add undo break-points -map("i", ",", ",u") -map("i", ".", ".u") -map("i", ";", ";u") - --- save file -map({ "i", "x", "n", "s" }, "", "w", { desc = "Save file" }) - ---keywordprg -map("n", "K", "norm! K", { desc = "Keywordprg" }) - --- better indenting -map("v", "<", "", ">gv") - --- new file -map("n", "fn", "enew", { desc = "New File" }) - --- Toggle NeoTree -map("n", "e", "NvimTreeToggle", { desc = "Toggle file explorer" }) - --- Telescope -map("n", "ff", "Telescope find_files", { desc = "Telescope find files" }) -map("n", "fg", "Telescope live_grep", { desc = "Telescope find files" }) -map("n", "fb", "Telescope buffers", { desc = "Telescope find files" }) - --- LSP -map("n", "gl", "lua vim.diagnostic.open_float()", { desc = "Show diagnostics" }) -map("n", "gd", "lua vim.lsp.buf.definition()", { desc = "Show diagnostics" }) -map("n", "gD", "lua vim.lsp.buf.declaration()", { desc = "Show diagnostics" }) -map("n", "K", "lua vim.lsp.buf.hover()", { desc = "Show diagnostics" }) - --- Buffers -map("n", "", "bn", { desc = "Cycle to next buffer" }) -map("n", "", "bp", { desc = "Cycle to previous buffer" }) -map("n", "bq", "b#|bd#", { desc = "Close current buffer" }) -map("n", "bq", "BufferLineCloseOthers", { desc = "Close all other buffers" }) diff --git a/modules/home/cli/neovim/options.lua b/modules/home/cli/neovim/options.lua deleted file mode 100644 index d605f76..0000000 --- a/modules/home/cli/neovim/options.lua +++ /dev/null @@ -1,57 +0,0 @@ -vim.g.mapleader = " " -vim.g.maplocalleader = "\\" - -local opt = vim.opt - -opt.autowrite = true -- Enable auto write -opt.clipboard = "unnamedplus" -- Sync with system clipboard -opt.completeopt = "menu,menuone,noselect" -opt.conceallevel = 3 -- Hide * markup for bold and italic -opt.confirm = true -- Confirm to save changes before exiting modified buffer -opt.cursorline = true -- Enable highlighting of the current line -opt.expandtab = true -- Use spaces instead of tabs -opt.formatoptions = "jcroqlnt" -- tcqj -opt.grepformat = "%f:%l:%c:%m" -opt.grepprg = "rg --vimgrep" -opt.ignorecase = true -- Ignore case -opt.inccommand = "nosplit" -- preview incremental substitute -opt.laststatus = 0 -opt.list = true -- Show some invisible characters (tabs... -opt.mouse = "a" -- Enable mouse mode -opt.number = true -- Print line number -opt.pumblend = 10 -- Popup blend -opt.pumheight = 10 -- Maximum number of entries in a popup -opt.relativenumber = true -- Relative line numbers -opt.scrolloff = 4 -- Lines of context -opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" } -opt.shiftround = true -- Round indent -opt.shiftwidth = 2 -- Size of an indent -opt.shortmess:append({ W = true, I = true, c = true }) -opt.showmode = true -- Dont show mode since we have a statusline -opt.sidescrolloff = 8 -- Columns of context -opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time -opt.smartcase = true -- Don't ignore case with capitals -opt.smartindent = true -- Insert indents automatically -opt.spelllang = { "en", "nl" } -opt.spell = false -- Enable spell -opt.splitbelow = true -- Put new windows below current -opt.splitright = true -- Put new windows right of current -opt.tabstop = 2 -- Number of spaces tabs count for -opt.termguicolors = true -- True color support -opt.timeoutlen = 300 -opt.undofile = true -opt.undolevels = 10000 -opt.updatetime = 200 -- Save swap file and trigger CursorHold -opt.wildmode = "longest:full,full" -- Command-line completion mode -opt.winminwidth = 5 -- Minimum window width -opt.wrap = false -- Disable line wrap - -if vim.fn.has("nvim-0.9.0") == 1 then - opt.splitkeep = "screen" - opt.shortmess:append({ C = true }) -end - --- Fix markdown indentation settings -vim.g.markdown_recommended_style = 0 - -vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]] diff --git a/modules/home/cli/neovim/plugins/bufferline.lua b/modules/home/cli/neovim/plugins/bufferline.lua deleted file mode 100644 index 0a53ed3..0000000 --- a/modules/home/cli/neovim/plugins/bufferline.lua +++ /dev/null @@ -1,12 +0,0 @@ -require('bufferline').setup{ - options = { - offsets = { - { - filetype = "NvimTree", - text = "File Explorer", - highlight = "Directory", - separator = true -- use a "true" to enable the default, or set your own character - } - } - } -} diff --git a/modules/home/cli/neovim/plugins/cmp.lua b/modules/home/cli/neovim/plugins/cmp.lua deleted file mode 100644 index cf2b7a7..0000000 --- a/modules/home/cli/neovim/plugins/cmp.lua +++ /dev/null @@ -1,46 +0,0 @@ -local cmp = require('cmp') -local luasnip = require('luasnip') - -require('luasnip.loaders.from_vscode').lazy_load() -luasnip.config.setup {} - -cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert { - [''] = cmp.mapping.select_next_item(), - [''] = cmp.mapping.select_prev_item(), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete {}, - [''] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }, - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { 'i', 's' }), - }, - sources = { - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - }, -} diff --git a/modules/home/cli/neovim/plugins/harpoon.lua b/modules/home/cli/neovim/plugins/harpoon.lua deleted file mode 100644 index d24130e..0000000 --- a/modules/home/cli/neovim/plugins/harpoon.lua +++ /dev/null @@ -1,10 +0,0 @@ -local mark = require('harpoon.mark') -local ui = require('harpoon.ui') - -vim.keymap.set("n", "q", mark.add_file) -vim.keymap.set("n", "", ui.toggle_quick_menu) - -vim.keymap.set("n", "", function() ui.nav_file(1) end) -vim.keymap.set("n", "", function() ui.nav_file(2) end) -vim.keymap.set("n", "", function() ui.nav_file(3) end) -vim.keymap.set("n", "", function() ui.nav_file(4) end) diff --git a/modules/home/cli/neovim/plugins/lsp.lua b/modules/home/cli/neovim/plugins/lsp.lua deleted file mode 100644 index 54ede15..0000000 --- a/modules/home/cli/neovim/plugins/lsp.lua +++ /dev/null @@ -1,57 +0,0 @@ -require("mason").setup{ - PATH = "append", -} -require("mason-lspconfig").setup() -require('neodev').setup() -require('lsp-inlayhints').setup() - -local lspconfig = require('lspconfig') - -vim.g.rustaceanvim = { - tools = { - hover_actions = { - auto_focus = true, - }, - }, - server = { - on_attach = function(client, bufnr) - require("lsp-inlayhints").on_attach(client, bufnr) - require("lsp-inlayhints").show() - end, - default_settings = { - ['rust-analyzer'] = { - cargo = { - features = "all" - }, - }, - }, - }, -} - -lspconfig.tsserver.setup{} - -lspconfig.spyglassmc_language_server.setup{ - cmd = { - "/home/xeovalyte/.npm-global/bin/spyglassmc-language-server", "--stdio" - } -} - -lspconfig.arduino_language_server.setup{ - cmd = { - "steam-run","arduino-language-server", - "-cli-config", "/home/xeovalyte/.arduino15/arduino-cli.yaml", - "-cli", "/usr/bin/arduino-cli", - "-clangd", "steam-run clangd" - } -} - -lspconfig.tailwindcss.setup{ - filetypes = { - "rust", - "css", - } -} - -lspconfig.volar.setup{} - -lspconfig.marksman.setup{} diff --git a/modules/home/cli/neovim/plugins/lualine.lua b/modules/home/cli/neovim/plugins/lualine.lua deleted file mode 100644 index 75ec32a..0000000 --- a/modules/home/cli/neovim/plugins/lualine.lua +++ /dev/null @@ -1,40 +0,0 @@ -require('lualine').setup { - options = { - icons_enabled = true, - theme = 'auto', - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - globalstatus = true, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - } - }, - sections = { - lualine_a = {'mode'}, - lualine_b = {'branch', 'diff', 'diagnostics'}, - lualine_c = {'filename'}, - lualine_x = {'encoding', 'fileformat', 'filetype'}, - lualine_y = {'progress'}, - lualine_z = {'location'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {'filename'}, - lualine_x = {'location'}, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {} -} diff --git a/modules/home/cli/neovim/plugins/markdown-preview.lua b/modules/home/cli/neovim/plugins/markdown-preview.lua deleted file mode 100644 index 5004380..0000000 --- a/modules/home/cli/neovim/plugins/markdown-preview.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.g.mkdp_auto_start = 0 -vim.g.mkdp_auto_close = 0 diff --git a/modules/home/cli/neovim/plugins/nvim-tree.lua b/modules/home/cli/neovim/plugins/nvim-tree.lua deleted file mode 100644 index 6314204..0000000 --- a/modules/home/cli/neovim/plugins/nvim-tree.lua +++ /dev/null @@ -1,20 +0,0 @@ -local function my_on_attach(bufnr) - local api = require "nvim-tree.api" - - local function opts(desc) - return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } - end - - -- default mappings - api.config.mappings.default_on_attach(bufnr) - - -- custom mappings - vim.keymap.set('n', '', api.tree.change_root_to_parent, opts('Up')) - vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help')) - vim.keymap.set('n', '.', api.tree.change_root_to_node, opts('CD')) -end - --- pass to setup along with your other options -require("nvim-tree").setup { - on_attach = my_on_attach, -} diff --git a/modules/home/cli/neovim/plugins/toggleterm.lua b/modules/home/cli/neovim/plugins/toggleterm.lua deleted file mode 100644 index c5fa966..0000000 --- a/modules/home/cli/neovim/plugins/toggleterm.lua +++ /dev/null @@ -1,7 +0,0 @@ -require("toggleterm").setup{ - open_mapping = [[]], - direction = 'float', - float_opts = { - border = 'curved' - } -} diff --git a/modules/home/cli/neovim/plugins/treesitter.lua b/modules/home/cli/neovim/plugins/treesitter.lua deleted file mode 100644 index 1c1ab24..0000000 --- a/modules/home/cli/neovim/plugins/treesitter.lua +++ /dev/null @@ -1,9 +0,0 @@ -require("nvim-treesitter.configs").setup{ - ensure_installed = {}, - - auto_install = false, - - highlight = { enable = true }, - - indent = { enable = true }, -} diff --git a/modules/home/cli/ssh.nix b/modules/home/cli/ssh.nix deleted file mode 100644 index 498e2fc..0000000 --- a/modules/home/cli/ssh.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, ... }: - -{ - programs.ssh = { - enable = true; - matchBlocks = { - archserver = { - hostname = "192.168.1.20"; - user = "xeovalyte"; - identityFile = "~/.ssh/archserver"; - }; - - "gitea.xeovalyte.dev" = { - hostname = "gitea.xeovalyte.dev"; - port = 2222; - user = "git"; - identityFile = "~/.ssh/gitea"; - }; - }; - addKeysToAgent = "yes"; - }; -} diff --git a/modules/home/cli/yazi.nix b/modules/home/cli/yazi.nix deleted file mode 100644 index 7986e39..0000000 --- a/modules/home/cli/yazi.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs, ... }: - -{ - programs.yazi = { - enable = true; - enableZshIntegration = true; - settings = { - opener = { - open = [ - { run = "xdg-open $@"; desc = "xdg"; orphan = true; } - ]; - }; - open = { - prepend_rules = [ - { name = "*.rnote"; use = "open"; } - ]; - }; - }; - }; -} diff --git a/modules/home/default.nix b/modules/home/default.nix new file mode 100644 index 0000000..9083f02 --- /dev/null +++ b/modules/home/default.nix @@ -0,0 +1,25 @@ +{ ... }: + +{ + imports = [ + ./applications/alacritty.nix + ./applications/common.nix + ./applications/devenv.nix + ./applications/firefox.nix + ./applications/git.nix + ./applications/helix.nix + ./applications/zsh.nix + ./applications/ssh.nix + ./applications/thunderbird.nix + ./applications/yazi.nix + ./applications/zellij.nix + + ./services/nextcloud.nix + + ./theming/fonts.nix + ./theming/nix-colors.nix + ./theming/stylix.nix + + ./desktop-environments/hyprland/default.nix + ]; +} diff --git a/modules/home/desktop-environments/hyprland/default.nix b/modules/home/desktop-environments/hyprland/default.nix new file mode 100644 index 0000000..0926746 --- /dev/null +++ b/modules/home/desktop-environments/hyprland/default.nix @@ -0,0 +1,214 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + cfg = config.settings.desktop-environments.hyprland; +in { + options = { + settings.desktop-environments.hyprland.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable hyprland window manager configuration + ''; + }; + }; + + imports = [ + ./waybar.nix + ./fixes.nix + ./dunst.nix + ./rofi.nix + ]; + + config = mkIf cfg.enable { + + home.packages = with pkgs; [ + alacritty + wev + brightnessctl + playerctl + wl-clipboard + grimblast + nwg-bar + powertop + lxqt.lxqt-policykit + + networkmanagerapplet + ]; + + wayland.windowManager.hyprland = { + enable = true; + settings = { + monitor = lib.mkIf (config.host == "xv-laptop") [ + "eDP-1,preferred,3840x0,1.333" + "DP-10,preferred,0x0,1" + "DP-9,preferred,1920x0,1" + ]; + + exec-once = [ + "waybar" + "lxqt-policykit-agent" + "nm-applet" + "blueman-applet" + ]; + + env = lib.mkIf (config.host == "xv-desktop") [ + "LIBVA_DRIVER_NAME,nvidia" + "XDG_SESSION_TYPE,wayland" + "GBM_BACKEND,nvidia-drm" + "__GLX_VENDOR_LIBRARY_NAME,nvidia" + ]; + + "$mod" = "SUPER"; + + input = { + follow_mouse = 2; + touchpad = { + natural_scroll = true; + scroll_factor = 0.5; + clickfinger_behavior = true; + }; + }; + + general = { + gaps_in = "5"; + gaps_out = "10"; + border_size = "2"; + + "col.active_border" = "rgba(00bfffee) rgba(36b7e2ee) 45deg"; + "col.inactive_border" = "rgba(0a3543aa)"; + + layout = "dwindle"; + }; + + decoration = { + rounding = "5"; + blur.enabled = "false"; + }; + + gestures = { + workspace_swipe = "on"; + workspace_swipe_distance = "200"; + }; + + misc = { + vfr = "true"; + vrr = 2; + force_default_wallpaper = "0"; + }; + + xwayland = { + force_zero_scaling = true; + }; + + workspace = lib.mkMerge [[ + + ] + (lib.mkIf (config.host == "xv-desktop") [ + "1, monitor:DP-1" + "2, monitor:DP-1" + "3, monitor:DP-1" + "4, monitor:DP-1" + "5, monitor:DP-1" + "6, monitor:HDMI-A-1" + "7, monitor:HDMI-A-1" + "8, monitor:HDMI-A-1" + "9, monitor:HDMI-A-1" + "10, monitor:HDMI-A-1" + ]) + (lib.mkIf (config.host == "xv-laptop") [ + "1, monitor:DP-10" + "2, monitor:DP-10" + "3, monitor:DP-10" + "4, monitor:DP-10" + "5, monitor:DP-9" + "6, monitor:DP-9" + "7, monitor:DP-9" + "8, monitor:eDP-1" + "9, monitor:eDP-1" + "10, monitor:eDP-1" + ])]; + + bind = [ + "$mod, Q, exec, alacritty" + "$mod, SPACE, exec, rofi -show drun" + ",Print, exec, grimblast copy area" + "$mod,ESCAPE, exec, nwg-bar" + "$mod, P, exit" + + "$mod, C, killactive" + "$mod SHIFT, C, exec, hyprctl kill" + "$mod, V, togglefloating" + "$mod, F, fullscreen, 0" + "$mod, M, fullscreen, 1" + "$mod SHIFT, L, exec, hyprlock" + "$mod, S, exec, systemctl suspend" + + "$mod, h, movefocus, l" + "$mod, l, movefocus, r" + "$mod, k, movefocus, u" + "$mod, j, movefocus, d" + + "$mod SHIFT, h, movewindow, l" + "$mod SHIFT, l, movewindow, r" + "$mod SHIFT, k, movewindow, u" + "$mod SHIFT, j, movewindow, d" + + "$mod ALT, h, resizeactive, -20 0" + "$mod ALT, l, resizeactive, 20 0" + "$mod ALT, k, resizeactive, 0 -20" + "$mod ALT, j, resizeactive, 0 20" + + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" + + "$mod SHIFT, 1, movetoworkspace, 1" + "$mod SHIFT, 2, movetoworkspace, 2" + "$mod SHIFT, 3, movetoworkspace, 3" + "$mod SHIFT, 4, movetoworkspace, 4" + "$mod SHIFT, 5, movetoworkspace, 5" + "$mod SHIFT, 6, movetoworkspace, 6" + "$mod SHIFT, 7, movetoworkspace, 7" + "$mod SHIFT, 8, movetoworkspace, 8" + "$mod SHIFT, 9, movetoworkspace, 9" + "$mod SHIFT, 0, movetoworkspace, 10" + ]; + + bindle = [ + # Volume control + ",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" + ",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + + # Brightness control + ",XF86MonBrightnessUp, exec, brightnessctl set 5%+" + ",XF86MonBrightnessDown, exec, brightnessctl set 5%-" + ]; + + bindl= [ + # Toggle audio mute + ",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + + # Media control + ",XF86AudioPlay, exec, playerctl play-pause" + ",XF86AudioNext, exec, playerctl next" + ",XF86AudioPrev, exec, playerctl previous" + ]; + + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + }; + }; + }; +} + diff --git a/modules/home/desktop-environments/hyprland/dunst.nix b/modules/home/desktop-environments/hyprland/dunst.nix new file mode 100644 index 0000000..3b1e039 --- /dev/null +++ b/modules/home/desktop-environments/hyprland/dunst.nix @@ -0,0 +1,7 @@ +{ config, ... }: + +{ + services.dunst = { + enable = config.settings.desktop-environments.hyprland.enable; + }; +} diff --git a/modules/home/gui/hyprland/fixes.nix b/modules/home/desktop-environments/hyprland/fixes.nix similarity index 100% rename from modules/home/gui/hyprland/fixes.nix rename to modules/home/desktop-environments/hyprland/fixes.nix diff --git a/modules/home/gui/hyprland/hyprpaper.nix b/modules/home/desktop-environments/hyprland/hyprpaper.nix similarity index 100% rename from modules/home/gui/hyprland/hyprpaper.nix rename to modules/home/desktop-environments/hyprland/hyprpaper.nix diff --git a/modules/home/gui/hyprland/kanshi.nix b/modules/home/desktop-environments/hyprland/kanshi.nix similarity index 100% rename from modules/home/gui/hyprland/kanshi.nix rename to modules/home/desktop-environments/hyprland/kanshi.nix diff --git a/modules/home/desktop-environments/hyprland/rofi.nix b/modules/home/desktop-environments/hyprland/rofi.nix new file mode 100644 index 0000000..1dbd943 --- /dev/null +++ b/modules/home/desktop-environments/hyprland/rofi.nix @@ -0,0 +1,117 @@ +{ config, pkgs, ... }: +{ + programs.rofi = { + enable = config.settings.desktop-environments.hyprland.enable; + package = pkgs.rofi-wayland; + # theme = let + # inherit (config.lib.formats.rasi) mkLiteral; + # in { + # "*" = { + # background-color = mkLiteral "#${config.colorScheme.palette.base00}"; + # foreground-color = mkLiteral "#${config.colorScheme.palette.base05}"; + # text-color = mkLiteral "#${config.colorScheme.palette.base07}"; + # border-color = mkLiteral "#${config.colorScheme.palette.base04}"; + # }; + # # Holds the entire window + # "#window" = { + # transparency = "real"; + # background-color = mkLiteral "#${config.colorScheme.palette.base00}"; + # text-color = mkLiteral "#${config.colorScheme.palette.base07}"; + # border = mkLiteral "0px"; + # border-color = mkLiteral "#${config.colorScheme.palette.base04}"; + # border-radius = mkLiteral "4px"; + # width = mkLiteral "850px"; + # padding = mkLiteral "8px"; + # }; + + # # Wrapper around bar and results + # "#mainbox" = { + # background-color = mkLiteral "#${config.colorScheme.palette.base00}"; + # border = mkLiteral "0px"; + # border-radius = mkLiteral "0px"; + # border-color = mkLiteral "#${config.colorScheme.palette.base04}"; + # children = map mkLiteral [ "inputbar" "message" "listview" ]; + # spacing = mkLiteral "10px"; + # padding = mkLiteral "10px"; + # }; + + # # Unknown + # "#textbox-prompt-colon" = { + # expand = false; + # str = ":"; + # margin = mkLiteral "0px 0.3em 0em 0em"; + # text-color = mkLiteral "#${config.colorScheme.palette.base07}"; + # }; + + # # Command prompt left of the input + # "#prompt" = { enabled = false; }; + + # # Actual text box + # "#entry" = { + # placeholder-color = mkLiteral "#${config.colorScheme.palette.base03}"; + # expand = true; + # horizontal-align = "0"; + # placeholder = ""; + # padding = mkLiteral "0px 0px 0px 5px"; + # blink = true; + # }; + + # # Top bar + # "#inputbar" = { + # children = map mkLiteral [ "prompt" "entry" ]; + # border = mkLiteral "1px"; + # border-radius = mkLiteral "4px"; + # padding = mkLiteral "6px"; + # }; + + # # Results + # "#listview" = { + # background-color = mkLiteral "#${config.colorScheme.palette.base00}"; + # padding = mkLiteral "0px"; + # columns = 1; + # lines = 12; + # spacing = "5px"; + # cycle = true; + # dynamic = true; + # layout = "vertical"; + # }; + + # # Each result + # "#element" = { + # orientation = "vertical"; + # border-radius = mkLiteral "0px"; + # padding = mkLiteral "5px 0px 5px 5px"; + # }; + # "#element.selected" = { + # border = mkLiteral "1px"; + # border-radius = mkLiteral "4px"; + # border-color = mkLiteral "#${config.colorScheme.palette.base07}"; + # background-color = mkLiteral "#${config.colorScheme.palette.base04}"; + # text-color = mkLiteral "#${config.colorScheme.palette.base00}"; + # }; + + # "#element-text" = { + # expand = true; + # # horizontal-align = mkLiteral "0.5"; + # vertical-align = mkLiteral "0.5"; + # margin = mkLiteral "0px 2.5px 0px 2.5px"; + # }; + # "#element-text.selected" = { + # background-color = mkLiteral "#${config.colorScheme.palette.base04}"; + # text-color = mkLiteral "#${config.colorScheme.palette.base00}"; + # }; + + # # Not sure how to get icons + # "#element-icon" = { + # size = mkLiteral "18px"; + # border = mkLiteral "0px"; + # padding = mkLiteral "2px 5px 2px 2px"; + # background-color = mkLiteral "#${config.colorScheme.palette.base00}"; + # }; + # "#element-icon.selected" = { + # background-color = mkLiteral "#${config.colorScheme.palette.base04}"; + # text-color = mkLiteral "#${config.colorScheme.palette.base00}"; + # }; + # }; + }; +} diff --git a/modules/home/gui/hyprland/waybar.nix b/modules/home/desktop-environments/hyprland/waybar.nix similarity index 98% rename from modules/home/gui/hyprland/waybar.nix rename to modules/home/desktop-environments/hyprland/waybar.nix index 193948a..c305f96 100644 --- a/modules/home/gui/hyprland/waybar.nix +++ b/modules/home/desktop-environments/hyprland/waybar.nix @@ -2,7 +2,7 @@ { programs.waybar = { - enable = true; + enable = config.settings.desktop-environments.hyprland.enable; settings = { mainBar = { layer = "top"; diff --git a/modules/home/gui/common/alacritty.nix b/modules/home/gui/common/alacritty.nix deleted file mode 100644 index abbbcc9..0000000 --- a/modules/home/gui/common/alacritty.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ config, ... }: - -{ - programs.alacritty = { - enable = true; - settings = { - font = { - normal = { family = "DejaVuSansM Nerd Font"; style = "Regular"; }; - }; - window = { - opacity = 0.8; - padding = { x = 10; y = 10; }; - }; - colors = { - draw_bold_text_with_bright_colors = false; - primary = { - background = "0x${config.colorScheme.palette.base00}"; - foreground = "0x${config.colorScheme.palette.base05}"; - }; - cursor = { - text = "0x${config.colorScheme.palette.base00}"; - cursor = "0x${config.colorScheme.palette.base05}"; - }; - normal = { - black = "0x${config.colorScheme.palette.base00}"; - red = "0x${config.colorScheme.palette.base08}"; - green = "0x${config.colorScheme.palette.base0B}"; - yellow = "0x${config.colorScheme.palette.base0A}"; - blue = "0x${config.colorScheme.palette.base0D}"; - magenta = "0x${config.colorScheme.palette.base0E}"; - cyan = "0x${config.colorScheme.palette.base0C}"; - white = "0x${config.colorScheme.palette.base05}"; - }; - bright = { - black = "0x${config.colorScheme.palette.base03}"; - red = "0x${config.colorScheme.palette.base09}"; - green = "0x${config.colorScheme.palette.base01}"; - yellow = "0x${config.colorScheme.palette.base02}"; - blue = "0x${config.colorScheme.palette.base04}"; - magenta = "0x${config.colorScheme.palette.base06}"; - cyan = "0x${config.colorScheme.palette.base0F}"; - white = "0x${config.colorScheme.palette.base07}"; - }; - }; - }; - }; -} diff --git a/modules/home/gui/common/default.nix b/modules/home/gui/common/default.nix deleted file mode 100644 index 05d2bb8..0000000 --- a/modules/home/gui/common/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ pkgs, ...}: - -{ - imports = [ - ./alacritty.nix - ./firefox.nix - ./fonts.nix - ]; - - home.packages = with pkgs; [ - vlc - bitwarden - pavucontrol - ]; -} diff --git a/modules/home/gui/common/firefox.nix b/modules/home/gui/common/firefox.nix deleted file mode 100644 index 5bf5cb5..0000000 --- a/modules/home/gui/common/firefox.nix +++ /dev/null @@ -1,154 +0,0 @@ -{ inputs, pkgs, ... }: - -{ - # about:policies - # Check about:support for extension/add-on ID strings. - # Check about:config for options. - - - home.packages = with pkgs; [ - unstable.firefoxpwa - ]; - - programs.firefox = { - enable = true; - nativeMessagingHosts = [ pkgs.unstable.firefoxpwa ]; - policies = { - DisableTelemetry = true; - DisableFirefoxStudies = true; - EnableTrackingProtection = { - Value = true; - Locked = true; - Cryptomining = true; - Fingerprinting = true; - }; - DisablePocket = true; - DisableFirefoxAccounts = true; - DisableAccounts = true; - DontCheckDefaultBrowser = true; - DisplayBookmarksToolbar = "newpage"; - ExtensionSettings = { - "nl-NL@dictionaries.addons.mozilla.org" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/woordenboek-nederlands/latest.xpi"; - installation_mode = "force_installed"; - }; - "uBlock0@raymondhill.net" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; - installation_mode = "force_installed"; - }; - "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi"; - installation_mode = "force_installed"; - }; - "firefoxpwa@filips.si" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/pwas-for-firefox/latest.xpi"; - installation_mode = "force_installed"; - }; - "markdown-viewer@outofindex.com" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/markdown-viewer-chrome/latest.xpi"; - installation_mode = "force_installed"; - }; - }; - }; - profiles.xeovalyte = { - bookmarks = [ - { - name = "Toolbar"; - toolbar = true; - bookmarks = [ - { - name = "Brightspace"; - bookmarks = [ - { - name = "Books"; - url = "https://drive.google.com/drive/folders/1L5OTbn5p3i7_Nc80hc5PztiEGHKwi-I4"; - } - { - name = "LCB"; - url = "https://brightspace.tudelft.nl/d2l/le/content/681010/Home"; - } - { - name = "Calculus"; - url = "https://brightspace.tudelft.nl/d2l/le/content/681024/Home"; - } - { - name = "IP1"; - url = "https://brightspace.tudelft.nl/d2l/le/content/681020/Home"; - } - ]; - } - ]; - } - ]; - search.engines = { - "Nix" = { - urls = [{ - template = "https://mynixos.com/search"; - params = [ - { name = "q"; value = "{searchTerms}"; } - ]; - }]; - - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@nix" ]; - }; - - "SearXNG" = { - urls = [{ - template = "https:/search.xeovalyte.dev/search"; - params = [ - { name = "q"; value = "{searchTerms}"; } - ]; - }]; - - definedAliases = [ "@searxng" ]; - }; - - "Startpage" = { - urls = [{ - template = "https:/startpage.com/sp/search"; - params = [ - { name = "q"; value = "{searchTerms}"; } - ]; - }]; - - definedAliases = [ "@sp" ]; - }; - - "Bing".metaData.hidden = true; - "Google".metaData.hidden = true; - "eBay".metaData.hidden = true; - }; - search.force = true; - search.default = "SearXNG"; - - settings = { - "browser.disableResetPrompt" = true; - "browser.download.panel.shown" = true; - "browser.download.useDownloadDir" = false; - "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; - "browser.shell.checkDefaultBrowser" = false; - "browser.shell.defaultBrowserCheckCount" = 1; - "dom.security.https_only_mode" = true; - "privacy.trackingProtection.enabled" = true; - "browser.toolbars.bookmarks.visibility" = "newtab"; - "browser.translations.neverTranslateLanguages" = "nl"; - "browser.newtabpage.pinned" = [ - { - label = "Server"; - url = "https://home.xeovalyte.dev"; - } - { - label = "Youtube"; - url = "https://youtube.com"; - } - { - label = "My TU Delft"; - url = "https://my.tudelft.nl/"; - } - ]; - "signon.rememberSignons" = false; - }; - }; - }; -} diff --git a/modules/home/gui/common/fonts.nix b/modules/home/gui/common/fonts.nix deleted file mode 100644 index 8171473..0000000 --- a/modules/home/gui/common/fonts.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ pkgs, inputs, ... }: - -{ - fonts.fontconfig.enable = true; - - home.packages = with pkgs; [ - noto-fonts - fira-code - font-awesome - dejavu_fonts - roboto - (nerdfonts.override { fonts = [ "DejaVuSansMono" ]; }) - inputs.apple-fonts.packages.${pkgs.system}.sf-pro - ]; -} diff --git a/modules/home/gui/hyprland/default.nix b/modules/home/gui/hyprland/default.nix deleted file mode 100644 index 3bc6c8a..0000000 --- a/modules/home/gui/hyprland/default.nix +++ /dev/null @@ -1,197 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - imports = [ - ./waybar.nix - ./fixes.nix - ./dunst.nix - ./rofi.nix - ]; - - home.packages = with pkgs; [ - alacritty - wev - brightnessctl - playerctl - wl-clipboard - grimblast - nwg-bar - powertop - lxqt.lxqt-policykit - - networkmanagerapplet - ]; - - wayland.windowManager.hyprland = { - enable = true; - settings = { - monitor = lib.mkIf (config.host == "xv-laptop") [ - "eDP-1,preferred,3840x0,1.333" - "DP-10,preferred,0x0,1" - "DP-9,preferred,1920x0,1" - ]; - - exec-once = [ - "waybar" - "lxqt-policykit-agent" - "nm-applet" - "blueman-applet" - ]; - - env = lib.mkIf (config.host == "xv-desktop") [ - "LIBVA_DRIVER_NAME,nvidia" - "XDG_SESSION_TYPE,wayland" - "GBM_BACKEND,nvidia-drm" - "__GLX_VENDOR_LIBRARY_NAME,nvidia" - ]; - - "$mod" = "SUPER"; - - input = { - follow_mouse = 2; - touchpad = { - natural_scroll = true; - scroll_factor = 0.5; - clickfinger_behavior = true; - }; - }; - - general = { - gaps_in = "5"; - gaps_out = "10"; - border_size = "2"; - - "col.active_border" = "rgba(00bfffee) rgba(36b7e2ee) 45deg"; - "col.inactive_border" = "rgba(0a3543aa)"; - - layout = "dwindle"; - }; - - decoration = { - rounding = "5"; - blur.enabled = "false"; - }; - - gestures = { - workspace_swipe = "on"; - workspace_swipe_distance = "200"; - }; - - misc = { - vfr = "true"; - vrr = 2; - force_default_wallpaper = "0"; - }; - - xwayland = { - force_zero_scaling = true; - }; - - workspace = lib.mkMerge [[ - - ] - (lib.mkIf (config.host == "xv-desktop") [ - "1, monitor:DP-1" - "2, monitor:DP-1" - "3, monitor:DP-1" - "4, monitor:DP-1" - "5, monitor:DP-1" - "6, monitor:HDMI-A-1" - "7, monitor:HDMI-A-1" - "8, monitor:HDMI-A-1" - "9, monitor:HDMI-A-1" - "10, monitor:HDMI-A-1" - ]) - (lib.mkIf (config.host == "xv-laptop") [ - "1, monitor:DP-10" - "2, monitor:DP-10" - "3, monitor:DP-10" - "4, monitor:DP-10" - "5, monitor:DP-9" - "6, monitor:DP-9" - "7, monitor:DP-9" - "8, monitor:eDP-1" - "9, monitor:eDP-1" - "10, monitor:eDP-1" - ])]; - - bind = [ - "$mod, Q, exec, alacritty" - "$mod, SPACE, exec, rofi -show drun" - ",Print, exec, grimblast copy area" - "$mod,ESCAPE, exec, nwg-bar" - "$mod, P, exit" - - "$mod, C, killactive" - "$mod SHIFT, C, exec, hyprctl kill" - "$mod, V, togglefloating" - "$mod, F, fullscreen, 0" - "$mod, M, fullscreen, 1" - "$mod SHIFT, L, exec, hyprlock" - "$mod, S, exec, systemctl suspend" - - "$mod, h, movefocus, l" - "$mod, l, movefocus, r" - "$mod, k, movefocus, u" - "$mod, j, movefocus, d" - - "$mod SHIFT, h, movewindow, l" - "$mod SHIFT, l, movewindow, r" - "$mod SHIFT, k, movewindow, u" - "$mod SHIFT, j, movewindow, d" - - "$mod ALT, h, resizeactive, -20 0" - "$mod ALT, l, resizeactive, 20 0" - "$mod ALT, k, resizeactive, 0 -20" - "$mod ALT, j, resizeactive, 0 20" - - "$mod, 1, workspace, 1" - "$mod, 2, workspace, 2" - "$mod, 3, workspace, 3" - "$mod, 4, workspace, 4" - "$mod, 5, workspace, 5" - "$mod, 6, workspace, 6" - "$mod, 7, workspace, 7" - "$mod, 8, workspace, 8" - "$mod, 9, workspace, 9" - "$mod, 0, workspace, 10" - - "$mod SHIFT, 1, movetoworkspace, 1" - "$mod SHIFT, 2, movetoworkspace, 2" - "$mod SHIFT, 3, movetoworkspace, 3" - "$mod SHIFT, 4, movetoworkspace, 4" - "$mod SHIFT, 5, movetoworkspace, 5" - "$mod SHIFT, 6, movetoworkspace, 6" - "$mod SHIFT, 7, movetoworkspace, 7" - "$mod SHIFT, 8, movetoworkspace, 8" - "$mod SHIFT, 9, movetoworkspace, 9" - "$mod SHIFT, 0, movetoworkspace, 10" - ]; - - bindle = [ - # Volume control - ",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" - ",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" - - # Brightness control - ",XF86MonBrightnessUp, exec, brightnessctl set 5%+" - ",XF86MonBrightnessDown, exec, brightnessctl set 5%-" - ]; - - bindl= [ - # Toggle audio mute - ",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" - - # Media control - ",XF86AudioPlay, exec, playerctl play-pause" - ",XF86AudioNext, exec, playerctl next" - ",XF86AudioPrev, exec, playerctl previous" - ]; - - bindm = [ - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - ]; - }; - }; -} diff --git a/modules/home/gui/hyprland/dunst.nix b/modules/home/gui/hyprland/dunst.nix deleted file mode 100644 index f3fb5e1..0000000 --- a/modules/home/gui/hyprland/dunst.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: - -{ - services.dunst = { - enable = true; - }; -} diff --git a/modules/home/gui/hyprland/rofi.nix b/modules/home/gui/hyprland/rofi.nix deleted file mode 100644 index 4bbfe91..0000000 --- a/modules/home/gui/hyprland/rofi.nix +++ /dev/null @@ -1,117 +0,0 @@ -{ config, pkgs, ... }: -{ - programs.rofi = { - enable = true; - package = pkgs.rofi-wayland; - theme = let - inherit (config.lib.formats.rasi) mkLiteral; - in { - "*" = { - background-color = mkLiteral "#${config.colorScheme.palette.base00}"; - foreground-color = mkLiteral "#${config.colorScheme.palette.base05}"; - text-color = mkLiteral "#${config.colorScheme.palette.base07}"; - border-color = mkLiteral "#${config.colorScheme.palette.base04}"; - }; - # Holds the entire window - "#window" = { - transparency = "real"; - background-color = mkLiteral "#${config.colorScheme.palette.base00}"; - text-color = mkLiteral "#${config.colorScheme.palette.base07}"; - border = mkLiteral "0px"; - border-color = mkLiteral "#${config.colorScheme.palette.base04}"; - border-radius = mkLiteral "4px"; - width = mkLiteral "850px"; - padding = mkLiteral "8px"; - }; - - # Wrapper around bar and results - "#mainbox" = { - background-color = mkLiteral "#${config.colorScheme.palette.base00}"; - border = mkLiteral "0px"; - border-radius = mkLiteral "0px"; - border-color = mkLiteral "#${config.colorScheme.palette.base04}"; - children = map mkLiteral [ "inputbar" "message" "listview" ]; - spacing = mkLiteral "10px"; - padding = mkLiteral "10px"; - }; - - # Unknown - "#textbox-prompt-colon" = { - expand = false; - str = ":"; - margin = mkLiteral "0px 0.3em 0em 0em"; - text-color = mkLiteral "#${config.colorScheme.palette.base07}"; - }; - - # Command prompt left of the input - "#prompt" = { enabled = false; }; - - # Actual text box - "#entry" = { - placeholder-color = mkLiteral "#${config.colorScheme.palette.base03}"; - expand = true; - horizontal-align = "0"; - placeholder = ""; - padding = mkLiteral "0px 0px 0px 5px"; - blink = true; - }; - - # Top bar - "#inputbar" = { - children = map mkLiteral [ "prompt" "entry" ]; - border = mkLiteral "1px"; - border-radius = mkLiteral "4px"; - padding = mkLiteral "6px"; - }; - - # Results - "#listview" = { - background-color = mkLiteral "#${config.colorScheme.palette.base00}"; - padding = mkLiteral "0px"; - columns = 1; - lines = 12; - spacing = "5px"; - cycle = true; - dynamic = true; - layout = "vertical"; - }; - - # Each result - "#element" = { - orientation = "vertical"; - border-radius = mkLiteral "0px"; - padding = mkLiteral "5px 0px 5px 5px"; - }; - "#element.selected" = { - border = mkLiteral "1px"; - border-radius = mkLiteral "4px"; - border-color = mkLiteral "#${config.colorScheme.palette.base07}"; - background-color = mkLiteral "#${config.colorScheme.palette.base04}"; - text-color = mkLiteral "#${config.colorScheme.palette.base00}"; - }; - - "#element-text" = { - expand = true; - # horizontal-align = mkLiteral "0.5"; - vertical-align = mkLiteral "0.5"; - margin = mkLiteral "0px 2.5px 0px 2.5px"; - }; - "#element-text.selected" = { - background-color = mkLiteral "#${config.colorScheme.palette.base04}"; - text-color = mkLiteral "#${config.colorScheme.palette.base00}"; - }; - - # Not sure how to get icons - "#element-icon" = { - size = mkLiteral "18px"; - border = mkLiteral "0px"; - padding = mkLiteral "2px 5px 2px 2px"; - background-color = mkLiteral "#${config.colorScheme.palette.base00}"; - }; - "#element-icon.selected" = { - background-color = mkLiteral "#${config.colorScheme.palette.base04}"; - text-color = mkLiteral "#${config.colorScheme.palette.base00}"; - }; - }; - }; -} diff --git a/modules/home/gui/modrinth.nix b/modules/home/gui/modrinth.nix deleted file mode 100644 index 2b6bfe8..0000000 --- a/modules/home/gui/modrinth.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ input, pkgs, lib, ... }: - -{ - - home.packages = with pkgs; [ - unstable.modrinth-app - ]; -} diff --git a/modules/home/gui/nextcloud.nix b/modules/home/gui/nextcloud.nix deleted file mode 100644 index af8e4de..0000000 --- a/modules/home/gui/nextcloud.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: - -{ - services.nextcloud-client = { - enable = true; - startInBackground = true; - }; -} diff --git a/modules/home/gui/thunderbird.nix b/modules/home/gui/thunderbird.nix deleted file mode 100644 index 24f4149..0000000 --- a/modules/home/gui/thunderbird.nix +++ /dev/null @@ -1,86 +0,0 @@ -{ pkgs, ... }: - -{ - programs.thunderbird = { - enable = true; - package = pkgs.unstable.thunderbird; - profiles = { - default = { - isDefault = true; - }; - }; - }; - - accounts.email.accounts = { - ziggo = { - imap = { - host = "imap.ziggo.nl"; - port = 993; - tls = { - enable = true; - }; - }; - smtp = { - host = "smtp.ziggo.nl"; - port = 587; - tls = { - enable = true; - useStartTls = true; - }; - }; - address = "timo.boomers@ziggo.nl"; - realName = "Timo Boomers"; - userName = "timo.boomers@ziggo.nl"; - primary = true; - thunderbird.enable = true; - thunderbird.profiles = [ "default" ]; - }; - tudelft = { - imap = { - host = "outlook.office365.com"; - port = 993; - tls = { - enable = true; - }; - }; - smtp = { - host = "smtp.office365.com"; - port = 587; - tls = { - enable = true; - useStartTls = false; - }; - }; - address = "tboomers@tudelft.nl"; - realName = "Timo Boomers"; - userName = "tboomers@tudelft.nl"; - primary = false; - thunderbird.enable = true; - thunderbird.profiles = [ "default" ]; - }; - xeovalyte = { - imap = { - host = "mail.xeovalyte.dev"; - port = 993; - tls = { - enable = true; - }; - }; - smtp = { - host = "mail.xeovalyte.dev"; - port = 587; - tls = { - enable = true; - useStartTls = true; - }; - }; - address = "timo@xeovalyte.dev"; - aliases = [ "me@xeovalyte.dev" "contact@xeovalyte.dev" ]; - realName = "Timo Boomers"; - userName = "me@xeovalyte.dev"; - primary = false; - thunderbird.enable = true; - thunderbird.profiles = [ "default" ]; - }; - }; -} diff --git a/modules/home/services/nextcloud.nix b/modules/home/services/nextcloud.nix new file mode 100644 index 0000000..cdab162 --- /dev/null +++ b/modules/home/services/nextcloud.nix @@ -0,0 +1,23 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.services.nextcloud-sync; +in { + options = { + settings.services.nextcloud-sync.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable Nextcloud syncronisation + ''; + }; + }; + + config = mkIf cfg.enable { + services.nextcloud-client = { + enable = true; + startInBackground = true; + }; + }; +} diff --git a/modules/home/theming/fonts.nix b/modules/home/theming/fonts.nix new file mode 100644 index 0000000..28682b7 --- /dev/null +++ b/modules/home/theming/fonts.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.settings.theming.fonts; +in { + options = { + settings.theming.fonts.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable fonts + ''; + }; + }; + + config = mkIf cfg.enable { + fonts.fontconfig.enable = true; + + home.packages = with pkgs; [ + noto-fonts + fira-code + font-awesome + dejavu_fonts + roboto + (nerdfonts.override { fonts = [ "DejaVuSansMono" ]; }) + ]; + }; +} diff --git a/modules/home/gui/theming.nix b/modules/home/theming/nix-colors.nix similarity index 77% rename from modules/home/gui/theming.nix rename to modules/home/theming/nix-colors.nix index b858239..78652b4 100644 --- a/modules/home/gui/theming.nix +++ b/modules/home/theming/nix-colors.nix @@ -1,15 +1,27 @@ { config, nix-colors, pkgs, lib, ... }: + +with lib; + let + cfg = config.settings.theming.nix-colors; inherit (nix-colors.lib-contrib { inherit pkgs; }) gtkThemeFromScheme; -in -{ +in { + options = { + settings.theming.nix-colors.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable nix colors configuration + ''; + }; + }; + imports = [ nix-colors.homeManagerModules.default ]; - config = { + config = mkIf cfg.enable { colorScheme = nix-colors.colorSchemes.da-one-sea; gtk = lib.mkIf (config.headless == false) { diff --git a/modules/home/theming/stylix.nix b/modules/home/theming/stylix.nix new file mode 100644 index 0000000..1800850 --- /dev/null +++ b/modules/home/theming/stylix.nix @@ -0,0 +1,38 @@ +{ config, lib, inputs, pkgs, ... }: + +with lib; + +let + cfg = config.settings.theming.stylix; +in { + options = { + settings.theming.stylix.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable stylix configuration + ''; + }; + }; + + imports = [ + inputs.stylix.homeManagerModules.stylix + ]; + + config = mkIf cfg.enable { + stylix.enable = true; + + stylix.image = ../../../assets/wallpaper-2.png; + stylix.polarity = "dark"; + stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/da-one-ocean.yaml"; + + stylix.autoEnable = true; + + stylix.cursor = { + package = pkgs.phinger-cursors; + name = "phinger-cursors-dark"; + size = 24; + }; + + stylix.fonts.sizes.applications = 10; + }; +} diff --git a/modules/system/applications/common.nix b/modules/system/applications/common.nix new file mode 100644 index 0000000..512e7eb --- /dev/null +++ b/modules/system/applications/common.nix @@ -0,0 +1,34 @@ +{ pkgs, config, lib, ... }: + +with lib; + +let + cfg = config.settings.applications.common; +in { + options = { + settings.applications.common.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable common applications + ''; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + usbutils + tree + fastfetch + btop + git + yazi + + just + ]; + + environment.pathsToLink = [ "/share/zsh" ]; + + programs.zsh.enable = true; + users.defaultUserShell = pkgs.zsh; + }; +} diff --git a/modules/system/applications/steam.nix b/modules/system/applications/steam.nix new file mode 100644 index 0000000..fe059e6 --- /dev/null +++ b/modules/system/applications/steam.nix @@ -0,0 +1,31 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.applications.steam; +in { + options = { + settings.applications.steam.enable = lib.mkOption { + type = with lib.types; bool; + description = '' + Enable steam + ''; + }; + }; + + config = mkIf cfg.enable { + nixpkgs.config.allowUnfree = true; + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "steam" + "steam-original" + "steam-run" + ]; + + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + }; + }; +} diff --git a/modules/system/applications/thunar.nix b/modules/system/applications/thunar.nix new file mode 100644 index 0000000..6fa980c --- /dev/null +++ b/modules/system/applications/thunar.nix @@ -0,0 +1,30 @@ +{ pkgs, config, lib, ... }: + +with lib; + +let + cfg = config.settings.applications.thunar; +in { + options = { + settings.applications.thunar.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable thunar file manager + ''; + }; + }; + + config = mkIf cfg.enable { + programs.thunar = { + enable = true; + plugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-volman + ]; + }; + + services.gvfs.enable = true; + services.tumbler.enable = true; + programs.file-roller.enable = true; + }; +} diff --git a/modules/system/cli/common.nix b/modules/system/cli/common.nix deleted file mode 100644 index 9805725..0000000 --- a/modules/system/cli/common.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, ... }: - -{ - environment.systemPackages = with pkgs; [ - usbutils - tree - fastfetch - btop - git - yazi - ]; - - environment.pathsToLink = [ "/share/zsh" ]; - - programs.zsh.enable = true; - users.defaultUserShell = pkgs.zsh; -} diff --git a/modules/system/cli/docker.nix b/modules/system/cli/docker.nix deleted file mode 100644 index 6f9a138..0000000 --- a/modules/system/cli/docker.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, ... }: - -{ - virtualisation.docker = { - enable = true; - rootless = { - enable = true; - setSocketVariable = true; - }; - }; - - users.users.xeovalyte.extraGroups = [ "docker" ]; - - security.wrappers = { - docker-rootlesskit = { - owner = "root"; - group = "root"; - capabilities = "cap_net_bind_service+ep"; - source = "${pkgs.rootlesskit}/bin/rootlesskit"; - }; - }; -} diff --git a/modules/system/cli/podman.nix b/modules/system/cli/podman.nix deleted file mode 100644 index 3d1718c..0000000 --- a/modules/system/cli/podman.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ pkgs, ... }: - -{ - virtualisation.containers.enable = true; - - virtualisation.podman = { - enable = true; - dockerCompat = true; - defaultNetwork.settings.dns_enabled = true; - }; - - virtualisation.oci-containers.backend = "podman"; - - environment.systemPackages = with pkgs; [ - dive - podman-tui - podman-compose - ]; -} diff --git a/modules/system/default.nix b/modules/system/default.nix new file mode 100644 index 0000000..170268f --- /dev/null +++ b/modules/system/default.nix @@ -0,0 +1,27 @@ +{ ... }: + +{ + imports = [ + ./applications/common.nix + ./applications/steam.nix + ./applications/thunar.nix + + ./services/docker.nix + ./services/quickemu.nix + ./services/sunshine.nix + ./services/garbage-collection.nix + + ./hardware/bluetooth.nix + ./hardware/fprint.nix + ./hardware/locale.nix + # ./hardware/nvidia.nix + ./hardware/firewall.nix + ./hardware/printing.nix + + ./desktop-environments/cosmic.nix + ./desktop-environments/hyprland.nix + ./desktop-environments/gnome.nix + + ./display-managers/default.nix + ]; +} diff --git a/modules/system/desktop-environments/cosmic.nix b/modules/system/desktop-environments/cosmic.nix new file mode 100644 index 0000000..4ccd6ee --- /dev/null +++ b/modules/system/desktop-environments/cosmic.nix @@ -0,0 +1,24 @@ +{ lib, config, ... }: + +with lib; + +let + cfg = config.settings.desktop-environments.cosmic; +in { + options = { + settings.desktop-environments.cosmic.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable cosmic desktop environment + ''; + }; + }; + + config = mkIf cfg.enable { + services.desktopManager.cosmic.enable = true; + + environment.sessionVariables = { + COSMIC_DISABLE_DIRECT_SCANOUT = "true"; + }; + }; +} diff --git a/modules/system/desktop-environments/gnome.nix b/modules/system/desktop-environments/gnome.nix new file mode 100644 index 0000000..955b3de --- /dev/null +++ b/modules/system/desktop-environments/gnome.nix @@ -0,0 +1,22 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.desktop-environments.gnome; +in { + options = { + settings.desktop-environments.gnome.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable gnome desktop environment + ''; + }; + }; + + config = mkIf cfg.enable { + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; + }; +} diff --git a/modules/system/desktop-environments/hyprland.nix b/modules/system/desktop-environments/hyprland.nix new file mode 100644 index 0000000..1178883 --- /dev/null +++ b/modules/system/desktop-environments/hyprland.nix @@ -0,0 +1,44 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + cfg = config.settings.desktop-environments.hyprland; +in { + options = { + settings.desktop-environments.hyprland.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable hyprland window manager + ''; + }; + }; + + config = mkIf cfg.enable { + programs.hyprland = { + enable = true; + package = pkgs.unstable.hyprland; + xwayland.enable = true; + }; + + # Sound configuration + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + # Keyring configuration + security.polkit.enable = true; + services.gnome.gnome-keyring.enable = true; + security.pam.services.greetd.enableGnomeKeyring = true; + programs.ssh.startAgent = true; + + # Configure networking + networking.networkmanager.enable = true; + networking.wireless.iwd.enable = true; + }; +} diff --git a/modules/system/display-managers/cosmic-greeter.nix b/modules/system/display-managers/cosmic-greeter.nix new file mode 100644 index 0000000..31541ed --- /dev/null +++ b/modules/system/display-managers/cosmic-greeter.nix @@ -0,0 +1,11 @@ +{ lib, config, ... }: + +with lib; + +let + cfg = config.settings.display-manager; +in { + config = mkIf (cfg == "cosmic-greeter") { + services.displayManager.cosmic-greeter.enable = true; + }; +} diff --git a/modules/system/display-managers/default.nix b/modules/system/display-managers/default.nix new file mode 100644 index 0000000..a4a279e --- /dev/null +++ b/modules/system/display-managers/default.nix @@ -0,0 +1,22 @@ +{ lib, ... }: + +with lib; + +let + cfg = config.settings.display-manager; +in { + options = { + settings.display-manager = lib.mkOption { + type = lib.types.enum ["sddm" "cosmic-greeter" "gdm"]; + description = '' + Specify which display manager to use + ''; + }; + }; + + imports = [ + ./sddm.nix + ./cosmic-greeter.nix + ./gdm.nix + ]; +} diff --git a/modules/system/display-managers/gdm.nix b/modules/system/display-managers/gdm.nix new file mode 100644 index 0000000..5292ffb --- /dev/null +++ b/modules/system/display-managers/gdm.nix @@ -0,0 +1,12 @@ +{ lib, config, ... }: + +with lib; + +let + cfg = config.settings.display-manager; +in { + config = mkIf (cfg == "gdm") { + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + }; +} diff --git a/modules/system/gui/sddm-theme.nix b/modules/system/display-managers/sddm-theme.nix similarity index 100% rename from modules/system/gui/sddm-theme.nix rename to modules/system/display-managers/sddm-theme.nix diff --git a/modules/system/display-managers/sddm.nix b/modules/system/display-managers/sddm.nix new file mode 100644 index 0000000..f9e72d9 --- /dev/null +++ b/modules/system/display-managers/sddm.nix @@ -0,0 +1,20 @@ +{ pkgs, lib, config, ... }: + +with lib; + +let + cfg = config.settings.display-manager; +in { + config = mkIf (cfg == "sddm") { + environment.systemPackages = with pkgs; [ + libsForQt5.qt5.qtquickcontrols2 + libsForQt5.qt5.qtgraphicaleffects + ]; + + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + theme = "${import ./sddm-theme.nix { inherit pkgs; }}"; + }; + }; +} diff --git a/modules/system/gui/hyprland.nix b/modules/system/gui/hyprland.nix deleted file mode 100644 index b718491..0000000 --- a/modules/system/gui/hyprland.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ config, pkgs, ... }: - -{ - programs.hyprland = { - enable = true; - package = pkgs.unstable.hyprland; - xwayland.enable = true; - }; - - # Configure display manager - # services.greetd = { - # enable = true; - # settings = { - # default_session = { - # command = "${pkgs.greetd.tuigreet}/bin/tuigreet --remember --time --cmd Hyprland"; - # user = "xeovalyte"; - # }; - # }; - # }; - - # SDDM configuration - environment.systemPackages = with pkgs; [ - libsForQt5.qt5.qtquickcontrols2 - libsForQt5.qt5.qtgraphicaleffects - ]; - - services.displayManager.sddm = { - enable = true; - wayland.enable = true; - theme = "${import ./sddm-theme.nix { inherit pkgs; }}"; - }; - - # Sound configuration - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - # Keyring configuration - security.polkit.enable = true; - services.gnome.gnome-keyring.enable = true; - security.pam.services.greetd.enableGnomeKeyring = true; - programs.ssh.startAgent = true; - - # Configure networking - networking.networkmanager.enable = true; - networking.wireless.iwd.enable = true; -} diff --git a/modules/system/gui/noisetorch.nix b/modules/system/gui/noisetorch.nix deleted file mode 100644 index 41434d6..0000000 --- a/modules/system/gui/noisetorch.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - programs.noisetorch.enable = true; -} diff --git a/modules/system/gui/plasma.nix b/modules/system/gui/plasma.nix deleted file mode 100644 index 7dfc6d7..0000000 --- a/modules/system/gui/plasma.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ pkgs, ... }: - -{ - services.displayManager.sddm.enable = true; - services.displayManager.sddm.wayland.enable = true; - - services.desktopManager.plasma6.enable = true; - - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; -} diff --git a/modules/system/gui/steam.nix b/modules/system/gui/steam.nix deleted file mode 100644 index fa52670..0000000 --- a/modules/system/gui/steam.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, lib, nixpkgs, ... }: - -{ - nixpkgs.config.allowUnfree = true; - nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ - "steam" - "steam-original" - "steam-run" - ]; - - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - }; -} diff --git a/modules/system/gui/sunshine.nix b/modules/system/gui/sunshine.nix deleted file mode 100644 index a9ec115..0000000 --- a/modules/system/gui/sunshine.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, ... }: - -{ - services.sunshine = { - enable = true; - package = pkgs.unstable.sunshine.override { cudaSupport = true; }; - autoStart = true; - capSysAdmin = true; - openFirewall = true; - }; -} diff --git a/modules/system/gui/thunar.nix b/modules/system/gui/thunar.nix deleted file mode 100644 index ed54653..0000000 --- a/modules/system/gui/thunar.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ pkgs, ... }: - -{ - programs.thunar = { - enable = true; - plugins = with pkgs.xfce; [ - thunar-archive-plugin - thunar-volman - ]; - }; - - services.gvfs.enable = true; - services.tumbler.enable = true; - programs.file-roller.enable = true; -} diff --git a/modules/system/hardware/amd.nix b/modules/system/hardware/amd.nix deleted file mode 100644 index aa285ef..0000000 --- a/modules/system/hardware/amd.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, ... }: - -{ - boot.initrd.kernelModules = [ "amdgpu" ]; - - hardware.graphics.enable = true; - hardware.graphics.extraPackages = with pkgs; [ - amdvlk - mesa.drivers - ]; - - hardware.graphics.extraPackages32 = with pkgs; [ - driversi686Linux.amdvlk - ]; - - programs.gamemode.enable = true; -} diff --git a/modules/system/hardware/bluetooth.nix b/modules/system/hardware/bluetooth.nix index 0921b77..36905a5 100644 --- a/modules/system/hardware/bluetooth.nix +++ b/modules/system/hardware/bluetooth.nix @@ -1,15 +1,30 @@ -{ pkgs, ... }: +{ config, lib, ... }: -{ - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - settings = { - General = { - Enable = "Source,Sink,Media,Socket"; - }; +with lib; + +let + cfg = config.settings.hardware.bluetooth; +in { + options = { + settings.hardware.bluetooth.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable bluetooth + ''; }; }; - services.blueman.enable = true; + config = mkIf cfg.enable { + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + settings = { + General = { + Enable = "Source,Sink,Media,Socket"; + }; + }; + }; + + services.blueman.enable = true; + }; } diff --git a/modules/system/hardware/firewall.nix b/modules/system/hardware/firewall.nix index 7b9bb93..83c1d32 100644 --- a/modules/system/hardware/firewall.nix +++ b/modules/system/hardware/firewall.nix @@ -1,9 +1,24 @@ -{ ... }: +{ config, lib, ... }: -{ - networking.firewall = { - enable = true; - allowedTCPPorts = [ ]; - allowedUDPPorts = [ ]; +with lib; + +let + cfg = config.settings.hardware.firewall; +in { + options = { + settings.hardware.firewall.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable firewall + ''; + }; + }; + + config = mkIf cfg.enable { + networking.firewall = { + enable = true; + allowedTCPPorts = [ ]; + allowedUDPPorts = [ ]; + }; }; } diff --git a/modules/system/hardware/fprint.nix b/modules/system/hardware/fprint.nix index ed90b20..04cbcbe 100644 --- a/modules/system/hardware/fprint.nix +++ b/modules/system/hardware/fprint.nix @@ -1,7 +1,23 @@ -{ lib, pkgs, ... }: +{ config, lib, ... }: -{ - services.fprintd.enable = true; +with lib; - security.pam.services.login.fprintAuth = false; +let + cfg = config.settings.hardware.fprint; +in { + options = { + settings.hardware.fprint.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable fingerprint + ''; + }; + }; + + config = mkIf cfg.enable { + services.fprintd.enable = true; + + security.pam.services.login.fprintAuth = false; + security.pam.services.cosmic-greeter.fprintAuth = false; + }; } diff --git a/modules/system/hardware/garbage-collection.nix b/modules/system/hardware/garbage-collection.nix deleted file mode 100644 index dcf217e..0000000 --- a/modules/system/hardware/garbage-collection.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: - -{ - nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 1w"; - }; - - nix.settings.auto-optimise-store = true; -} diff --git a/modules/system/hardware/laptop.nix b/modules/system/hardware/laptop.nix deleted file mode 100644 index 48dbd88..0000000 --- a/modules/system/hardware/laptop.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ ... }: - -{ - # services.auto-cpufreq.enable = true; - # services.auto-cpufreq.settings = { - # battery = { - # governor = "powersave"; - # turbo = "never"; - # }; - # charger = { - # governor = "performance"; - # turbo = "auto"; - # }; - # }; - - services.power-profiles-daemon.enable = true; - - boot.extraModprobeConfig = '' - options snd_hda_intel power_save=0 - ''; - - # powerManagement.powertop.enable = true; -} - diff --git a/modules/system/hardware/locale.nix b/modules/system/hardware/locale.nix index f12783d..69b5eb9 100644 --- a/modules/system/hardware/locale.nix +++ b/modules/system/hardware/locale.nix @@ -1,21 +1,36 @@ -{ ... }: +{ config, lib, ... }: -{ - # Set your time zone. - time.timeZone = "Europe/Amsterdam"; +with lib; - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; +let + cfg = config.settings.hardware.locale; +in { + options = { + settings.hardware.locale.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable locale configuration + ''; + }; + }; - i18n.extraLocaleSettings = { - LC_ADDRESS = "nl_NL.UTF-8"; - LC_IDENTIFICATION = "nl_NL.UTF-8"; - LC_MEASUREMENT = "nl_NL.UTF-8"; - LC_MONETARY = "nl_NL.UTF-8"; - LC_NAME = "nl_NL.UTF-8"; - LC_NUMERIC = "nl_NL.UTF-8"; - LC_PAPER = "nl_NL.UTF-8"; - LC_TELEPHONE = "nl_NL.UTF-8"; - LC_TIME = "nl_NL.UTF-8"; + config = mkIf cfg.enable { + # Set your time zone. + time.timeZone = "Europe/Amsterdam"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "nl_NL.UTF-8"; + LC_IDENTIFICATION = "nl_NL.UTF-8"; + LC_MEASUREMENT = "nl_NL.UTF-8"; + LC_MONETARY = "nl_NL.UTF-8"; + LC_NAME = "nl_NL.UTF-8"; + LC_NUMERIC = "nl_NL.UTF-8"; + LC_PAPER = "nl_NL.UTF-8"; + LC_TELEPHONE = "nl_NL.UTF-8"; + LC_TIME = "nl_NL.UTF-8"; + }; }; } diff --git a/modules/system/hardware/nvidia.nix b/modules/system/hardware/nvidia.nix index b4c05e9..eb1004c 100644 --- a/modules/system/hardware/nvidia.nix +++ b/modules/system/hardware/nvidia.nix @@ -1,37 +1,32 @@ -{ config, lib, pkgs, nixpkgs, ... }: +{ config, lib, ... }: -{ - nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ - "nvidia-x11" - "nvidia-settings" - ]; +with lib; - hardware.opengl = { - enable = true; - driSupport = true; - driSupport32Bit = true; +let + cfg = config.settings.hardware.nvidia; +in { + options = { + settings.hardware.firewall.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable nvidia drivers + ''; + }; }; - services.xserver.videoDrivers = ["nvidia"]; # or "nvidiaLegacy470 etc. + config = mkIf cfg.enable { + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "nvidia-x11" + "nvidia-settings" + ]; - hardware.nvidia = { + hardware.graphics.enable = true; - modesetting.enable = true; + services.xserver.videoDrivers = ["nvidia"]; # or "nvidiaLegacy470 etc. - powerManagement.enable = false; - - # Fine-grained power management. Turns off GPU when not in use. - # Experimental and only works on modern Nvidia GPUs (Turing or newer). - powerManagement.finegrained = false; - - # Use the NVidia open source kernel module (not to be confused with the - # independent third-party "nouveau" open source driver). - # Support is limited to the Turing and later architectures. Full list of - # supported GPUs is at: - # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus - # Only available from driver 515.43.04+ - # Currently alpha-quality/buggy, so false is currently the recommended setting. - open = false; - nvidiaSettings = true; + hardware.nvidia = { + open = true; + package = config.boot.kernelPackages.nvidiaPackages.beta; + }; }; } diff --git a/modules/system/hardware/printing.nix b/modules/system/hardware/printing.nix index 91f6389..1f4f43d 100644 --- a/modules/system/hardware/printing.nix +++ b/modules/system/hardware/printing.nix @@ -1,8 +1,23 @@ -{ pkgs, ... }: +{ config, lib, pkgs, ... }: -{ - services.printing = { - enable = true; - drivers = [ pkgs.hplip ]; +with lib; + +let + cfg = config.settings.hardware.printing; +in { + options = { + settings.hardware.printing.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable printer configuration + ''; + }; + }; + + config = mkIf cfg.enable { + services.printing = { + enable = true; + drivers = [ pkgs.hplip ]; + }; }; } diff --git a/modules/system/hardware/virt.nix b/modules/system/hardware/virt.nix deleted file mode 100644 index a08d6f9..0000000 --- a/modules/system/hardware/virt.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: - -{ - virtualisation.libvirtd.enable = true; - programs.virt-manager.enable = true; - - users.users.xeovalyte.extraGroups = [ "libvirtd" ]; - - environment.systemPackages = with pkgs; [ - quickemu - ]; -} diff --git a/modules/system/services/docker.nix b/modules/system/services/docker.nix new file mode 100644 index 0000000..4bf70c9 --- /dev/null +++ b/modules/system/services/docker.nix @@ -0,0 +1,37 @@ +{ pkgs, lib, config, ... }: + +with lib; + +let + cfg = config.settings.services.docker; +in { + options = { + settings.services.docker.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable docker configuration + ''; + }; + }; + + config = mkIf cfg.enable { + virtualisation.docker = { + enable = true; + rootless = { + enable = true; + setSocketVariable = true; + }; + }; + + users.users.xeovalyte.extraGroups = [ "docker" ]; + + security.wrappers = { + docker-rootlesskit = { + owner = "root"; + group = "root"; + capabilities = "cap_net_bind_service+ep"; + source = "${pkgs.rootlesskit}/bin/rootlesskit"; + }; + }; + }; +} diff --git a/modules/system/services/garbage-collection.nix b/modules/system/services/garbage-collection.nix new file mode 100644 index 0000000..945b02b --- /dev/null +++ b/modules/system/services/garbage-collection.nix @@ -0,0 +1,26 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.services.garbage-collection; +in { + options = { + settings.services.garbage-collection.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable garbage collection of nix store + ''; + }; + }; + + config = mkIf cfg.enable { + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 1w"; + }; + + nix.settings.auto-optimise-store = true; + }; +} diff --git a/modules/system/services/quickemu.nix b/modules/system/services/quickemu.nix new file mode 100644 index 0000000..7b87145 --- /dev/null +++ b/modules/system/services/quickemu.nix @@ -0,0 +1,27 @@ +{ pkgs, config, lib, ... }: + +with lib; + +let + cfg = config.settings.services.quickemu; +in { + options = { + settings.services.quickemu.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable quickemu virtualisation + ''; + }; + }; + + config = mkIf cfg.enable { + virtualisation.libvirtd.enable = true; + programs.virt-manager.enable = true; + + users.users.xeovalyte.extraGroups = [ "libvirtd" ]; + + environment.systemPackages = with pkgs; [ + quickemu + ]; + }; +} diff --git a/modules/system/services/sunshine.nix b/modules/system/services/sunshine.nix new file mode 100644 index 0000000..622c4ab --- /dev/null +++ b/modules/system/services/sunshine.nix @@ -0,0 +1,26 @@ +{ pkgs, config, lib, ... }: + +with lib; + +let + cfg = config.settings.services.sunshine; +in { + options = { + settings.services.sunshine.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable sunshine service + ''; + }; + }; + + config = mkIf cfg.enable { + services.sunshine = { + enable = true; + package = pkgs.unstable.sunshine.override { cudaSupport = true; }; + autoStart = true; + capSysAdmin = true; + openFirewall = true; + }; + }; +}