From 8fe060429932e9921d4b2a16eeb18abfcfd7a84b Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Sun, 29 Sep 2024 23:48:55 +0200 Subject: [PATCH] repo: huge refactor Refactored the entire repository structure, as putting everything into modules was just awkward. Took heavy inspiration from fufexan's repository, fufexan/dotfiles, as the structure felt much saner. --- flake.lock | 344 +------ flake.nix | 90 +- home/common/default.nix | 9 - home/common/mime.nix | 16 - home/common/programs/default.nix | 8 - home/common/programs/gnupg.nix | 11 - home/common/programs/nezia-public-key.asc | 15 - home/{common/core.nix => default.nix} | 3 + home/desktop/default.nix | 5 - home/laptop/default.nix | 5 - home/profiles/default.nix | 10 + home/profiles/solaire/default.nix | 13 + home/profiles/vamos/default.nix | 13 + home/{common => }/programs/browsers.nix | 0 .../default.nix} | 4 + home/programs/editors/neovim.nix | 120 +++ home/programs/games/default.nix | 15 + home/programs/gnome/default.nix | 60 ++ .../automount.nix => services/udiskie.nix} | 0 home/terminal/default.nix | 6 + home/terminal/emulators/gnome-terminal.nix | 15 + home/terminal/emulators/wezterm.nix | 71 ++ home/terminal/programs/default.nix | 21 + .../shell => terminal/programs}/direnv.nix | 0 home/{common => terminal}/programs/git.nix | 0 home/terminal/programs/gnupg.nix | 8 + home/{common => terminal}/programs/tmux.nix | 0 .../shell => terminal/programs}/zellij.nix | 0 home/{common => terminal}/shell/default.nix | 4 +- home/{common => terminal}/shell/fish.nix | 0 home/{common => terminal}/shell/starship.nix | 0 home/{common => terminal}/shell/zoxide.nix | 0 hosts/common/default.nix | 13 - hosts/common/sops.nix | 14 - hosts/common/syncthing/default.nix | 51 - hosts/common/syncthing/devices.nix | 9 - hosts/common/system/core.nix | 34 - hosts/common/system/default.nix | 11 - hosts/common/system/locale.nix | 19 - hosts/common/system/misc.nix | 11 - hosts/common/system/nh.nix | 11 - hosts/common/system/packages.nix | 11 - hosts/default.nix | 52 + hosts/solaire/default.nix | 49 +- hosts/vamos/default.nix | 26 +- modules/default.nix | 8 - modules/gui/default.nix | 6 - modules/gui/floorp/default.nix | 915 ------------------ modules/gui/gnome.nix | 140 --- modules/gui/wezterm.nix | 87 -- modules/other/default.nix | 7 - modules/other/gaming.nix | 52 - modules/other/nvidia.nix | 46 - modules/other/stylix.nix | 54 -- modules/services/default.nix | 6 - modules/services/docker.nix | 20 - modules/services/pipewire.nix | 32 - modules/tui/default.nix | 5 - modules/tui/neovim.nix | 134 --- secrets/secrets.yaml | 29 - {hosts/common/system => system/core}/boot.nix | 0 system/core/default.nix | 25 + system/core/users.nix | 10 + system/default.nix | 28 + system/hardware/fprintd.nix | 3 + system/hardware/fwupd.nix | 3 + system/hardware/nvidia.nix | 33 + system/hardware/power.nix | 3 + .../system => system/hardware}/printing.nix | 0 system/hardware/uni-sync.nix | 37 + system/hardware/via.nix | 7 + system/network/default.nix | 13 + system/nix/default.nix | 14 + system/nix/nh.nix | 9 + system/nix/nixpkgs.nix | 3 + system/programs/default.nix | 10 + system/programs/fonts.nix | 21 + system/programs/gamemode.nix | 11 + system/programs/games.nix | 16 + system/programs/gnome.nix | 39 + system/programs/home-manager.nix | 10 + system/services/default.nix | 3 + system/services/docker.nix | 9 + system/services/gnupg.nix | 6 + system/services/keyd.nix | 17 + system/services/pipewire.nix | 22 + system/syncthing/default.nix | 8 + 87 files changed, 853 insertions(+), 2225 deletions(-) delete mode 100644 home/common/default.nix delete mode 100644 home/common/mime.nix delete mode 100644 home/common/programs/default.nix delete mode 100644 home/common/programs/gnupg.nix delete mode 100644 home/common/programs/nezia-public-key.asc rename home/{common/core.nix => default.nix} (81%) delete mode 100644 home/desktop/default.nix delete mode 100644 home/laptop/default.nix create mode 100644 home/profiles/default.nix create mode 100644 home/profiles/solaire/default.nix create mode 100644 home/profiles/vamos/default.nix rename home/{common => }/programs/browsers.nix (100%) rename home/{common/programs/miscellaneous.nix => programs/default.nix} (84%) create mode 100644 home/programs/editors/neovim.nix create mode 100644 home/programs/games/default.nix create mode 100644 home/programs/gnome/default.nix rename home/{common/automount.nix => services/udiskie.nix} (100%) create mode 100644 home/terminal/default.nix create mode 100644 home/terminal/emulators/gnome-terminal.nix create mode 100644 home/terminal/emulators/wezterm.nix create mode 100644 home/terminal/programs/default.nix rename home/{common/shell => terminal/programs}/direnv.nix (100%) rename home/{common => terminal}/programs/git.nix (100%) create mode 100644 home/terminal/programs/gnupg.nix rename home/{common => terminal}/programs/tmux.nix (100%) rename home/{common/shell => terminal/programs}/zellij.nix (100%) rename home/{common => terminal}/shell/default.nix (64%) rename home/{common => terminal}/shell/fish.nix (100%) rename home/{common => terminal}/shell/starship.nix (100%) rename home/{common => terminal}/shell/zoxide.nix (100%) delete mode 100644 hosts/common/default.nix delete mode 100644 hosts/common/sops.nix delete mode 100644 hosts/common/syncthing/default.nix delete mode 100644 hosts/common/syncthing/devices.nix delete mode 100644 hosts/common/system/core.nix delete mode 100644 hosts/common/system/default.nix delete mode 100644 hosts/common/system/locale.nix delete mode 100644 hosts/common/system/misc.nix delete mode 100644 hosts/common/system/nh.nix delete mode 100644 hosts/common/system/packages.nix create mode 100644 hosts/default.nix delete mode 100644 modules/default.nix delete mode 100644 modules/gui/default.nix delete mode 100644 modules/gui/floorp/default.nix delete mode 100644 modules/gui/gnome.nix delete mode 100644 modules/gui/wezterm.nix delete mode 100644 modules/other/default.nix delete mode 100644 modules/other/gaming.nix delete mode 100644 modules/other/nvidia.nix delete mode 100644 modules/other/stylix.nix delete mode 100644 modules/services/default.nix delete mode 100644 modules/services/docker.nix delete mode 100644 modules/services/pipewire.nix delete mode 100644 modules/tui/default.nix delete mode 100644 modules/tui/neovim.nix delete mode 100644 secrets/secrets.yaml rename {hosts/common/system => system/core}/boot.nix (100%) create mode 100644 system/core/default.nix create mode 100644 system/core/users.nix create mode 100644 system/default.nix create mode 100644 system/hardware/fprintd.nix create mode 100644 system/hardware/fwupd.nix create mode 100644 system/hardware/nvidia.nix create mode 100644 system/hardware/power.nix rename {hosts/common/system => system/hardware}/printing.nix (100%) create mode 100644 system/hardware/uni-sync.nix create mode 100644 system/hardware/via.nix create mode 100644 system/network/default.nix create mode 100644 system/nix/default.nix create mode 100644 system/nix/nh.nix create mode 100644 system/nix/nixpkgs.nix create mode 100644 system/programs/default.nix create mode 100644 system/programs/fonts.nix create mode 100644 system/programs/gamemode.nix create mode 100644 system/programs/games.nix create mode 100644 system/programs/gnome.nix create mode 100644 system/programs/home-manager.nix create mode 100644 system/services/default.nix create mode 100644 system/services/docker.nix create mode 100644 system/services/gnupg.nix create mode 100644 system/services/keyd.nix create mode 100644 system/services/pipewire.nix create mode 100644 system/syncthing/default.nix diff --git a/flake.lock b/flake.lock index 02d9f87..88d3f92 100644 --- a/flake.lock +++ b/flake.lock @@ -1,136 +1,26 @@ { "nodes": { - "base16": { - "inputs": { - "fromYaml": "fromYaml" - }, - "locked": { - "lastModified": 1708890466, - "narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=", - "owner": "SenchoPens", - "repo": "base16.nix", - "rev": "665b3c6748534eb766c777298721cece9453fdae", - "type": "github" - }, - "original": { - "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-foot": { - "flake": false, - "locked": { - "lastModified": 1696725948, - "narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=", - "owner": "tinted-theming", - "repo": "base16-foot", - "rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-foot", - "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" - } - }, - "base16-kitty": { - "flake": false, - "locked": { - "lastModified": 1665001328, - "narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=", - "owner": "kdrag0n", - "repo": "base16-kitty", - "rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805", - "type": "github" - }, - "original": { - "owner": "kdrag0n", - "repo": "base16-kitty", - "type": "github" - } - }, - "base16-tmux": { - "flake": false, - "locked": { - "lastModified": 1696725902, - "narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=", - "owner": "tinted-theming", - "repo": "base16-tmux", - "rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-tmux", - "type": "github" - } - }, - "base16-vim": { - "flake": false, - "locked": { - "lastModified": 1716150083, - "narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=", - "owner": "tinted-theming", - "repo": "base16-vim", - "rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-vim", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1726153070, + "narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" }, @@ -150,14 +40,16 @@ }, "flake-utils": { "inputs": { - "systems": "systems" + "systems": [ + "systems" + ] }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -168,10 +60,7 @@ }, "flake-utils_2": { "inputs": { - "systems": [ - "stylix", - "systems" - ] + "systems": "systems" }, "locked": { "lastModified": 1710146030, @@ -189,7 +78,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_5" + "systems": "systems_4" }, "locked": { "lastModified": 1710146030, @@ -222,39 +111,6 @@ "type": "github" } }, - "fromYaml": { - "flake": false, - "locked": { - "lastModified": 1689549921, - "narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=", - "owner": "SenchoPens", - "repo": "fromYaml", - "rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84", - "type": "github" - }, - "original": { - "owner": "SenchoPens", - "repo": "fromYaml", - "type": "github" - } - }, - "gnome-shell": { - "flake": false, - "locked": { - "lastModified": 1713702291, - "narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=", - "owner": "GNOME", - "repo": "gnome-shell", - "rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934", - "type": "github" - }, - "original": { - "owner": "GNOME", - "ref": "46.1", - "repo": "gnome-shell", - "type": "github" - } - }, "harfbuzz": { "flake": false, "locked": { @@ -292,27 +148,6 @@ "type": "github" } }, - "home-manager_2": { - "inputs": { - "nixpkgs": [ - "stylix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1724435763, - "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, "libpng": { "flake": false, "locked": { @@ -436,22 +271,6 @@ "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" } }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1725762081, - "narHash": "sha256-vNv+aJUW5/YurRy1ocfvs4q/48yVESwlC/yHzjkZSP8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "dc454045f5b5d814e5862a6d057e7bb5c29edc05", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_2": { "locked": { "lastModified": 1656753965, @@ -469,22 +288,6 @@ } }, "nixpkgs_3": { - "locked": { - "lastModified": 1725194671, - "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { "locked": { "lastModified": 1726871744, "narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=", @@ -500,7 +303,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "locked": { "lastModified": 1725634671, "narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=", @@ -534,8 +337,8 @@ }, "nvf": { "inputs": { - "flake-parts": "flake-parts", - "flake-utils": "flake-utils", + "flake-parts": "flake-parts_2", + "flake-utils": "flake-utils_2", "mnw": "mnw", "nil": "nil", "nixpkgs": [ @@ -2282,13 +2085,13 @@ }, "root": { "inputs": { + "flake-parts": "flake-parts", + "flake-utils": "flake-utils", "home-manager": "home-manager", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nvf": "nvf", - "sops-nix": "sops-nix", - "stylix": "stylix", - "systems": "systems_4", + "systems": "systems_3", "treefmt-nix": "treefmt-nix", "wezterm": "wezterm", "zen-browser": "zen-browser" @@ -2342,57 +2145,6 @@ "type": "github" } }, - "sops-nix": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1726524647, - "narHash": "sha256-qis6BtOOBBEAfUl7FMHqqTwRLB61OL5OFzIsOmRz2J4=", - "owner": "Mic92", - "repo": "sops-nix", - "rev": "e2d404a7ea599a013189aa42947f66cede0645c8", - "type": "github" - }, - "original": { - "owner": "Mic92", - "repo": "sops-nix", - "type": "github" - } - }, - "stylix": { - "inputs": { - "base16": "base16", - "base16-fish": "base16-fish", - "base16-foot": "base16-foot", - "base16-helix": "base16-helix", - "base16-kitty": "base16-kitty", - "base16-tmux": "base16-tmux", - "base16-vim": "base16-vim", - "flake-compat": "flake-compat", - "flake-utils": "flake-utils_2", - "gnome-shell": "gnome-shell", - "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_3", - "systems": "systems_3" - }, - "locked": { - "lastModified": 1727093531, - "narHash": "sha256-hsb1bcUvpMecFHOP5F3LEyOnXiZ+5MikR92irJ8o7iE=", - "owner": "danth", - "repo": "stylix", - "rev": "eccb9f2d63f4582b1c1ffe97d806156147aeee5f", - "type": "github" - }, - "original": { - "owner": "danth", - "repo": "stylix", - "type": "github" - } - }, "systems": { "locked": { "lastModified": 1681028828, @@ -2425,34 +2177,20 @@ }, "systems_3": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default", + "repo": "default-linux", "type": "github" } }, "systems_4": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "id": "systems", - "type": "indirect" - } - }, - "systems_5": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -2469,7 +2207,7 @@ }, "treefmt-nix": { "inputs": { - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1727252110, @@ -2531,7 +2269,7 @@ }, "zen-browser": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1726001766, diff --git a/flake.nix b/flake.nix index d502570..fce38f9 100644 --- a/flake.nix +++ b/flake.nix @@ -1,83 +1,63 @@ { description = "nezia's nixos configuration"; - outputs = { - nixpkgs, - systems, - home-manager, - sops-nix, - stylix, - treefmt-nix, - ... - } @ inputs: let - username = "nezia"; - system = "x86_64-linux"; - # small tool to iterate over each systems - eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system}); - # eval the treefmt modules from ./treefmt.nix - treefmtEval = eachSystem (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix); + outputs = inputs: + inputs.flake-parts.lib.mkFlake {inherit inputs;} { + systems = ["x86-64_linux"]; - commonModules = hostname: [ - ./modules - ./hosts/common - ./hosts/${hostname} + imports = [ + ./hosts + ]; - sops-nix.nixosModules.sops - stylix.nixosModules.stylix - home-manager.nixosModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - extraSpecialArgs = { - inherit inputs system; - }; - }; - } - { - _module.args = { - inherit hostname username; - }; - } - ]; - - configureSystem = hostname: homeConfig: - nixpkgs.lib.nixosSystem { - inherit system; - modules = commonModules hostname ++ [{home-manager.users."${username}" = import homeConfig;}]; - specialArgs = { - inherit inputs; + perSystem = { + config, + pkgs, + ... + }: { + devShells.default = pkgs.mkShell { + packages = [ + pkgs.alejandra + pkgs.git + ]; }; + formatter = pkgs.alejandra; }; - in { - nixosConfigurations = { - vamos = configureSystem "vamos" ./home/laptop; - solaire = configureSystem "solaire" ./home/desktop; }; - formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper); - }; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - sops-nix = { - url = "github:Mic92/sops-nix"; - inputs.nixpkgs.follows = "nixpkgs"; + # global, so they can be `.follow`ed + systems.url = "github:nix-systems/default-linux"; + + flake-utils = { + url = "github:numtide/flake-utils"; + inputs.systems.follows = "systems"; }; - stylix.url = "github:danth/stylix"; + + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; + + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + wezterm = { url = "github:wez/wezterm/main?dir=nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + zen-browser.url = "github:MarceColl/zen-browser-flake"; nvf = { url = "github:notashelf/nvf"; inputs.nixpkgs.follows = "nixpkgs"; }; + treefmt-nix.url = "github:numtide/treefmt-nix"; + nixos-hardware.url = "github:NixOS/nixos-hardware"; }; } diff --git a/home/common/default.nix b/home/common/default.nix deleted file mode 100644 index 1f1b1eb..0000000 --- a/home/common/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -_: { - imports = [ - ./core.nix - ./automount.nix - ./mime.nix - ./shell - ./programs - ]; -} diff --git a/home/common/mime.nix b/home/common/mime.nix deleted file mode 100644 index 6dfa925..0000000 --- a/home/common/mime.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - xdg.mimeApps = { - enable = true; - # TODO: make this a module (this is impractical, i should make it more generic) - defaultApplications = { - "default-web-browser" = ["floorp.desktop"]; - "text/html" = ["floorp.desktop"]; - "x-scheme-handler/http" = ["floorp.desktop"]; - "x-scheme-handler/https" = ["floorp.desktop"]; - "x-scheme-handler/about" = ["floorp.desktop"]; - "x-scheme-handler/unknown" = ["floorp.desktop"]; - "application/pdf" = ["org.gnome.Evince.desktop"]; - "audio/wav" = ["rhythmbox"]; - }; - }; -} diff --git a/home/common/programs/default.nix b/home/common/programs/default.nix deleted file mode 100644 index cad9067..0000000 --- a/home/common/programs/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -_: { - imports = [ - ./git.nix - ./gnupg.nix - ./browsers.nix - ./miscellaneous.nix - ]; -} diff --git a/home/common/programs/gnupg.nix b/home/common/programs/gnupg.nix deleted file mode 100644 index 5555ef3..0000000 --- a/home/common/programs/gnupg.nix +++ /dev/null @@ -1,11 +0,0 @@ -_: { - programs.gpg = { - enable = true; - publicKeys = [ - { - source = ./nezia-public-key.asc; - trust = 5; - } - ]; - }; -} diff --git a/home/common/programs/nezia-public-key.asc b/home/common/programs/nezia-public-key.asc deleted file mode 100644 index 6231a6b..0000000 --- a/home/common/programs/nezia-public-key.asc +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Comment: Hostname: -Version: Hockeypuck 2.2 - -xjMEZKvcMBYJKwYBBAHaRw8BAQdAaYkPQIOlp8VGA4IsxNUz+EVjViDRmh0lQu1H -UGnY5XbNJUFudGhvbnkgUm9kcmlndWV6IDxhbnRob255QG5lemlhLmRldj7CkwQT -FgoAOxYhBCKjzYm9/VFRuQ4xqO476XwECobOBQJkq9wwAhsDBQsJCAcCAiICBhUK -CQgLAgQWAgMBAh4HAheAAAoJEO476XwECobOsQAA/j73e84XCql0D43q11eko5Cd -c8yx9oepeW6YZ6o/JW2fAP4gL3srCsHwefyfxx4E6B9cLE5yCr+mj+GOz6sBNQel -Bc44BGSr3DASCisGAQQBl1UBBQEBB0Bh4Lq9FF4VIvJ9U3/wI3nDQ/0C3uNMjBai -1cQ85G3BLgMBCAfCeAQYFgoAIBYhBCKjzYm9/VFRuQ4xqO476XwECobOBQJkq9ww -AhsMAAoJEO476XwECobO5bcA/1sikRqGxLp+7JcvfydxcS42NB/SMez5sLWXgdou -StrZAP9qwQIpPUTroVOP7mAPqi3BJupItSztX0EWiDba5HnIAQ== -=eYef ------END PGP PUBLIC KEY BLOCK----- diff --git a/home/common/core.nix b/home/default.nix similarity index 81% rename from home/common/core.nix rename to home/default.nix index 97f2628..ff33287 100644 --- a/home/common/core.nix +++ b/home/default.nix @@ -1,4 +1,7 @@ _: { + imports = [ + ./terminal + ]; home = { username = "nezia"; homeDirectory = "/home/nezia"; diff --git a/home/desktop/default.nix b/home/desktop/default.nix deleted file mode 100644 index c2f9b5f..0000000 --- a/home/desktop/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -_: { - imports = [ - ../common - ]; -} diff --git a/home/laptop/default.nix b/home/laptop/default.nix deleted file mode 100644 index c2f9b5f..0000000 --- a/home/laptop/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -_: { - imports = [ - ../common - ]; -} diff --git a/home/profiles/default.nix b/home/profiles/default.nix new file mode 100644 index 0000000..f2c6250 --- /dev/null +++ b/home/profiles/default.nix @@ -0,0 +1,10 @@ +{ + vamos = [ + ../. + ./vamos + ]; + solaire = [ + ../. + ./solaire + ]; +} diff --git a/home/profiles/solaire/default.nix b/home/profiles/solaire/default.nix new file mode 100644 index 0000000..4c4b1f3 --- /dev/null +++ b/home/profiles/solaire/default.nix @@ -0,0 +1,13 @@ +{ + imports = [ + ../../programs/editors/neovim.nix + + ../../programs + ../../programs/games + + ../../services/udiskie.nix + + ../../terminal/emulators/gnome-terminal.nix + ../../terminal/emulators/wezterm.nix + ]; +} diff --git a/home/profiles/vamos/default.nix b/home/profiles/vamos/default.nix new file mode 100644 index 0000000..9afc746 --- /dev/null +++ b/home/profiles/vamos/default.nix @@ -0,0 +1,13 @@ +{ + imports = [ + ../../programs/editors/neovim.nix + + ../../programs + ../../programs/gnome + + ../../services/udiskie.nix + + ../../terminal/emulators/gnome-terminal.nix + ../../terminal/emulators/wezterm.nix + ]; +} diff --git a/home/common/programs/browsers.nix b/home/programs/browsers.nix similarity index 100% rename from home/common/programs/browsers.nix rename to home/programs/browsers.nix diff --git a/home/common/programs/miscellaneous.nix b/home/programs/default.nix similarity index 84% rename from home/common/programs/miscellaneous.nix rename to home/programs/default.nix index b03a845..baf9f3d 100644 --- a/home/common/programs/miscellaneous.nix +++ b/home/programs/default.nix @@ -1,4 +1,8 @@ {pkgs, ...}: { + imports = [ + ./browsers.nix + ]; + programs.fzf.enable = true; programs.fastfetch.enable = true; home.packages = with pkgs; [ diff --git a/home/programs/editors/neovim.nix b/home/programs/editors/neovim.nix new file mode 100644 index 0000000..fadf0af --- /dev/null +++ b/home/programs/editors/neovim.nix @@ -0,0 +1,120 @@ +{ + inputs, + pkgs, + lib, + ... +}: { + imports = [inputs.nvf.homeManagerModules.default]; + + programs.nvf = { + enable = true; + settings.vim = { + viAlias = true; + vimAlias = true; + enableLuaLoader = true; + preventJunkFiles = true; + tabWidth = 4; + autoIndent = false; + useSystemClipboard = true; + + luaConfigPost = lib.concatStrings [ + '' + vim.opt.formatoptions:remove('c') + vim.opt.formatoptions:remove('r') + vim.opt.formatoptions:remove('o') + '' + ]; + + maps = { + normal = { + "m" = { + silent = true; + action = "make"; + }; # Same as nnoremap m make + "t" = { + silent = true; + action = "Neotree toggle"; + }; + }; + }; + theme = { + enable = true; + name = "catppuccin"; + style = "frappe"; + }; + + visuals = { + enable = true; + nvimWebDevicons.enable = true; + }; + + ui = { + noice.enable = true; + }; + notify.nvim-notify.enable = true; + + statusline.lualine = { + enable = true; + theme = "catppuccin"; + }; + + git.enable = true; + + lsp = { + enable = true; + lspSignature.enable = true; + lspconfig.enable = true; + formatOnSave = true; + mappings = { + addWorkspaceFolder = "wa"; + codeAction = "a"; + goToDeclaration = "gD"; + goToDefinition = "gd"; + hover = "K"; + listImplementations = "gi"; + listReferences = "gr"; + listWorkspaceFolders = "wl"; + nextDiagnostic = "k"; + previousDiagnostic = "j"; + openDiagnosticFloat = "e"; + removeWorkspaceFolder = "wr"; + renameSymbol = "r"; + signatureHelp = ""; + }; + }; + + autocomplete = { + enable = true; + alwaysComplete = true; + }; + + autopairs.enable = true; + languages = { + enableExtraDiagnostics = true; + enableFormat = true; + enableLSP = true; + enableTreesitter = true; + + nix.enable = true; + clang.enable = true; + python.enable = true; + }; + + treesitter = { + enable = true; + fold = true; + context.enable = true; + grammars = [ + pkgs.vimPlugins.nvim-treesitter.builtGrammars.nix + pkgs.vimPlugins.nvim-treesitter.builtGrammars.c + pkgs.vimPlugins.nvim-treesitter.builtGrammars.python + ]; + }; + + binds.whichKey.enable = true; + filetree.neo-tree.enable = true; + + telescope.enable = true; + }; + }; +} diff --git a/home/programs/games/default.nix b/home/programs/games/default.nix new file mode 100644 index 0000000..1c52374 --- /dev/null +++ b/home/programs/games/default.nix @@ -0,0 +1,15 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + protonup-qt + bottles + lutris + path-of-building + r2modman + + # steamtinkerlaunch dependencies + xdotool + xorg.xwininfo + yad + ]; + programs.mangohud.enable = true; +} diff --git a/home/programs/gnome/default.nix b/home/programs/gnome/default.nix new file mode 100644 index 0000000..c93b360 --- /dev/null +++ b/home/programs/gnome/default.nix @@ -0,0 +1,60 @@ +{ + pkgs, + config, + ... +}: { + dconf = { + enable = true; + settings = { + "org/gnome/shell" = { + disable-user-extensions = false; # enables user extensions + enabled-extensions = [ + pkgs.gnomeExtensions.appindicator.extensionUuid + pkgs.gnomeExtensions.blur-my-shell.extensionUuid + pkgs.gnomeExtensions.emoji-copy.extensionUuid + pkgs.gnomeExtensions.clipboard-history.extensionUuid + ]; + }; + "org/gnome/desktop/input-sources" = { + xkb-options = ["compose:ralt"]; + }; + "org/gnome/desktop/interface" = { + enable-hot-corners = false; + color-scheme = "prefer-dark"; + }; + "org/gnome/desktop/search-providers" = { + disabled = [ + "org.gnome.Terminal.desktop" + "org.gnome.Software.desktop" + "org.gnome.seahorse.Application.desktop" + "org.gnome.clocks.desktop" + "org.gnome.Characters.desktop" + "org.gnome.Calendar.desktop" + "org.gnome.Calculator.desktop" + ]; + + enabled = [ + "org.gnome.Nautilus.desktop" + "org.gnome.Settings.desktop" + ]; + }; + "org/freedesktop/tracker/mine/files" = { + index-recursive-directories = [ + "&DESKTOP" + "&DOCUMENTS" + "&MUSIC" + "&PICTURES" + "&VIDEOS" + "${config.home.homeDirectory}/Notes" + "${config.home.homeDirectory}/Projects" + ]; + }; + }; + }; + home.packages = with pkgs.gnomeExtensions; [ + appindicator + blur-my-shell + clipboard-history + emoji-copy + ]; +} diff --git a/home/common/automount.nix b/home/services/udiskie.nix similarity index 100% rename from home/common/automount.nix rename to home/services/udiskie.nix diff --git a/home/terminal/default.nix b/home/terminal/default.nix new file mode 100644 index 0000000..14a96a4 --- /dev/null +++ b/home/terminal/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./programs + ./shell + ]; +} diff --git a/home/terminal/emulators/gnome-terminal.nix b/home/terminal/emulators/gnome-terminal.nix new file mode 100644 index 0000000..85d3c70 --- /dev/null +++ b/home/terminal/emulators/gnome-terminal.nix @@ -0,0 +1,15 @@ +{ + programs.gnome-terminal = { + enable = true; + showMenubar = false; + profile = { + "4621184a-b921-42cf-80a0-7784516606f2" = { + default = true; + audibleBell = false; + allowBold = true; + visibleName = "default"; + font = "monospace 14"; + }; + }; + }; +} diff --git a/home/terminal/emulators/wezterm.nix b/home/terminal/emulators/wezterm.nix new file mode 100644 index 0000000..1617433 --- /dev/null +++ b/home/terminal/emulators/wezterm.nix @@ -0,0 +1,71 @@ +_: { + programs.wezterm = { + enable = true; + # package = inputs.wezterm.packages.${pkgs.system}.default; + extraConfig = '' + local w = require('wezterm') + + local function is_vim(pane) + return pane:get_user_vars().IS_NVIM == 'true' + end + + local direction_keys = { + h = 'Left', + j = 'Down', + k = 'Up', + l = 'Right', + } + + local function split_nav(resize_or_move, key) + return { + key = key, + mods = resize_or_move == 'resize' and 'META' or 'CTRL', + action = w.action_callback(function(win, pane) + if is_vim(pane) then + win:perform_action({ + SendKey = { key = key, mods = resize_or_move == 'resize' and 'META' or 'CTRL' }, + }, pane) + else + if resize_or_move == 'resize' then + win:perform_action({ AdjustPaneSize = { direction_keys[key], 3 } }, pane) + else + win:perform_action({ ActivatePaneDirection = direction_keys[key] }, pane) + end + end + end), + } + end + + return { + enable_wayland = false, + front_end = "WebGpu", + hide_tab_bar_if_only_one_tab = true, + show_new_tab_button_in_tab_bar = false, + harfbuzz_features = { "ss01", "ss03" }, + + leader = { key = " ", mods = "CTRL", timeout_milliseconds = 1000 }, + + keys = { + { + mods = "LEADER", + key = "-", + action = wezterm.action.SplitVertical { domain = "CurrentPaneDomain" } + }, + { + mods = "LEADER", + key = "=", + action = wezterm.action.SplitHorizontal { domain = "CurrentPaneDomain" } + }, + split_nav('move', 'h'), + split_nav('move', 'j'), + split_nav('move', 'k'), + split_nav('move', 'l'), + split_nav('resize', 'h'), + split_nav('resize', 'j'), + split_nav('resize', 'k'), + split_nav('resize', 'l'), + }, + } + ''; + }; +} diff --git a/home/terminal/programs/default.nix b/home/terminal/programs/default.nix new file mode 100644 index 0000000..0614717 --- /dev/null +++ b/home/terminal/programs/default.nix @@ -0,0 +1,21 @@ +{pkgs, ...}: { + imports = [ + ./git.nix + ./gnupg.nix + ./tmux.nix + ./direnv.nix + ./zellij.nix + ]; + + home.packages = with pkgs; [ + # archives + zip + unzip + unrar + + # utils + fd + file + ripgrep + ]; +} diff --git a/home/common/shell/direnv.nix b/home/terminal/programs/direnv.nix similarity index 100% rename from home/common/shell/direnv.nix rename to home/terminal/programs/direnv.nix diff --git a/home/common/programs/git.nix b/home/terminal/programs/git.nix similarity index 100% rename from home/common/programs/git.nix rename to home/terminal/programs/git.nix diff --git a/home/terminal/programs/gnupg.nix b/home/terminal/programs/gnupg.nix new file mode 100644 index 0000000..26a0a49 --- /dev/null +++ b/home/terminal/programs/gnupg.nix @@ -0,0 +1,8 @@ +{ + programs.gpg.enable = true; + services.gpg-agent = { + enable = true; + enableBashIntegration = true; + enableFishIntegration = true; + }; +} diff --git a/home/common/programs/tmux.nix b/home/terminal/programs/tmux.nix similarity index 100% rename from home/common/programs/tmux.nix rename to home/terminal/programs/tmux.nix diff --git a/home/common/shell/zellij.nix b/home/terminal/programs/zellij.nix similarity index 100% rename from home/common/shell/zellij.nix rename to home/terminal/programs/zellij.nix diff --git a/home/common/shell/default.nix b/home/terminal/shell/default.nix similarity index 64% rename from home/common/shell/default.nix rename to home/terminal/shell/default.nix index 6d3e127..3910822 100644 --- a/home/common/shell/default.nix +++ b/home/terminal/shell/default.nix @@ -1,9 +1,7 @@ -_: { +{ imports = [ ./fish.nix ./starship.nix ./zoxide.nix - ./direnv.nix - ./zellij.nix ]; } diff --git a/home/common/shell/fish.nix b/home/terminal/shell/fish.nix similarity index 100% rename from home/common/shell/fish.nix rename to home/terminal/shell/fish.nix diff --git a/home/common/shell/starship.nix b/home/terminal/shell/starship.nix similarity index 100% rename from home/common/shell/starship.nix rename to home/terminal/shell/starship.nix diff --git a/home/common/shell/zoxide.nix b/home/terminal/shell/zoxide.nix similarity index 100% rename from home/common/shell/zoxide.nix rename to home/terminal/shell/zoxide.nix diff --git a/hosts/common/default.nix b/hosts/common/default.nix deleted file mode 100644 index 843d230..0000000 --- a/hosts/common/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -_: { - imports = [ - ./system - ./syncthing - ./sops.nix - ]; - modules = { - gnome.enable = true; - stylix.enable = true; - docker.enable = true; - pipewire.enable = true; - }; -} diff --git a/hosts/common/sops.nix b/hosts/common/sops.nix deleted file mode 100644 index c5a5d02..0000000 --- a/hosts/common/sops.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - hostname, - username, - ... -}: { - sops = { - defaultSopsFile = ../../secrets/secrets.yaml; - defaultSopsFormat = "yaml"; - age.keyFile = "/home/${username}/.config/sops/age/keys.txt"; - - secrets."syncthing/${hostname}/key" = {}; - secrets."syncthing/${hostname}/cert" = {}; - }; -} diff --git a/hosts/common/syncthing/default.nix b/hosts/common/syncthing/default.nix deleted file mode 100644 index 18753f1..0000000 --- a/hosts/common/syncthing/default.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ - config, - username, - hostname, - ... -}: let - homeDir = "/home/${username}"; - devices = import ./devices.nix; - otherDevices = builtins.removeAttrs devices [hostname]; -in { - services = { - syncthing = { - enable = true; - user = "${username}"; - dataDir = "${homeDir}/Documents"; - configDir = "${homeDir}/.config/syncthing"; # Folder for Syncthing's settings and keys - key = "${config.sops.secrets."syncthing/${hostname}/key".path}"; - cert = "${config.sops.secrets."syncthing/${hostname}/cert".path}"; - settings = { - devices = otherDevices; - folders = { - "Documents" = { - path = "${homeDir}/Documents"; - devices = builtins.attrNames otherDevices; - }; - "Pictures" = { - path = "${homeDir}/Pictures"; - devices = builtins.attrNames otherDevices; - }; - "Music" = { - path = "${homeDir}/Music"; - devices = builtins.attrNames otherDevices; - }; - "Videos" = { - path = "${homeDir}/Videos"; - devices = builtins.attrNames otherDevices; - }; - "Projects" = { - path = "${homeDir}/Projects"; - devices = builtins.attrNames otherDevices; - }; - "Notes" = { - path = "${homeDir}/Notes"; - devices = builtins.attrNames otherDevices; - }; - }; - }; - }; - }; - systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true"; # Don't create default ~/Sync folder -} diff --git a/hosts/common/syncthing/devices.nix b/hosts/common/syncthing/devices.nix deleted file mode 100644 index 87a0950..0000000 --- a/hosts/common/syncthing/devices.nix +++ /dev/null @@ -1,9 +0,0 @@ -# TODO: add to sops directly instead of relying on another nix file -{ - "vamos" = { - id = "UO6JWVU-MTLZGVQ-Z3QAFYH-6PW2QR6-SBOVM6P-S6JXR2S-A7VYAU2-RLRXEQY"; - }; - "solaire" = { - id = "R5RK7CH-DRFXW4E-ARTPMHN-UMWYQ4O-QK7F3TA-EHVLDK4-DQ6CBT4-XRRWQQM"; - }; -} diff --git a/hosts/common/system/core.nix b/hosts/common/system/core.nix deleted file mode 100644 index e06e30e..0000000 --- a/hosts/common/system/core.nix +++ /dev/null @@ -1,34 +0,0 @@ -{hostname, ...}: { - networking.hostName = hostname; - networking.networkmanager.enable = true; - services = { - xserver.xkb = { - layout = "us"; - variant = ""; - }; - - # automount - udisks2.enable = true; - - fwupd.enable = true; - }; - - users.users.nezia = { - isNormalUser = true; - description = "Anthony Rodriguez"; - extraGroups = [ - "networkmanager" - "wheel" - ]; - }; - - nixpkgs.config.allowUnfree = true; - hardware.enableAllFirmware = true; - - system.stateVersion = "24.05"; - - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; -} diff --git a/hosts/common/system/default.nix b/hosts/common/system/default.nix deleted file mode 100644 index 62d1a51..0000000 --- a/hosts/common/system/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -_: { - imports = [ - ./core.nix - ./boot.nix - ./locale.nix - ./packages.nix - ./printing.nix - ./misc.nix - ./nh.nix - ]; -} diff --git a/hosts/common/system/locale.nix b/hosts/common/system/locale.nix deleted file mode 100644 index 52022ba..0000000 --- a/hosts/common/system/locale.nix +++ /dev/null @@ -1,19 +0,0 @@ -_: { - # Set your time zone. - time.timeZone = "Europe/Paris"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "fr_CH.UTF-8"; - LC_IDENTIFICATION = "fr_CH.UTF-8"; - LC_MEASUREMENT = "fr_CH.UTF-8"; - LC_MONETARY = "fr_CH.UTF-8"; - LC_NAME = "fr_CH.UTF-8"; - LC_NUMERIC = "fr_CH.UTF-8"; - LC_PAPER = "fr_CH.UTF-8"; - LC_TELEPHONE = "fr_CH.UTF-8"; - LC_TIME = "fr_CH.UTF-8"; - }; -} diff --git a/hosts/common/system/misc.nix b/hosts/common/system/misc.nix deleted file mode 100644 index dc56967..0000000 --- a/hosts/common/system/misc.nix +++ /dev/null @@ -1,11 +0,0 @@ -_: { - # fix direnv integration with fish - environment.pathsToLink = ["/share/fish"]; - - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - services.flatpak.enable = true; -} diff --git a/hosts/common/system/nh.nix b/hosts/common/system/nh.nix deleted file mode 100644 index 76208da..0000000 --- a/hosts/common/system/nh.nix +++ /dev/null @@ -1,11 +0,0 @@ -{username, ...}: { - programs.nh = { - enable = true; - clean.enable = true; - clean.extraArgs = "--keep-since 4d --keep 3"; - }; - - environment.sessionVariables = { - FLAKE = "/home/${username}/.dotfiles"; - }; -} diff --git a/hosts/common/system/packages.nix b/hosts/common/system/packages.nix deleted file mode 100644 index 0f2eee1..0000000 --- a/hosts/common/system/packages.nix +++ /dev/null @@ -1,11 +0,0 @@ -{pkgs, ...}: { - environment.systemPackages = with pkgs; [ - vim - git - wget - curl - tree - python3 - lm_sensors - ]; -} diff --git a/hosts/default.nix b/hosts/default.nix new file mode 100644 index 0000000..382cf41 --- /dev/null +++ b/hosts/default.nix @@ -0,0 +1,52 @@ +{ + self, + inputs, + ... +}: { + flake.nixosConfigurations = let + inherit (inputs.nixpkgs.lib) nixosSystem; + homeImports = import "${self}/home/profiles"; + mod = "${self}/system"; + inherit (import mod) laptop desktop; + specialArgs = {inherit inputs self;}; + in { + vamos = nixosSystem { + inherit specialArgs; + modules = + laptop + ++ [ + ./vamos + + "${mod}/programs/gnome.nix" + + { + home-manager = { + users.nezia.imports = homeImports.vamos; + extraSpecialArgs = specialArgs; + }; + } + + inputs.nixos-hardware.nixosModules.framework-13-7040-amd + ]; + }; + + solaire = nixosSystem { + inherit specialArgs; + modules = + desktop + ++ [ + ./solaire + + "${mod}/programs/gnome.nix" + "${mod}/hardware/nvidia.nix" + + { + home-manager = { + users.nezia.imports = homeImports.solaire; + extraSpecialArgs = specialArgs; + }; + } + ]; + }; + }; +} diff --git a/hosts/solaire/default.nix b/hosts/solaire/default.nix index f1c074b..f2649b0 100644 --- a/hosts/solaire/default.nix +++ b/hosts/solaire/default.nix @@ -2,51 +2,6 @@ imports = [ ./hardware-configuration.nix ]; - - hardware.uni-sync = { - enable = true; - devices = [ - { - device_id = "VID:3314/PID:41218/SN:6243168001"; - sync_rgb = true; - channels = [ - { - mode = "Manual"; - speed = 60; - } - { - mode = "Manual"; - speed = 60; - } - { - mode = "Manual"; - speed = 60; - } - { - mode = "Manual"; - speed = 60; - } - ]; - } - ]; - }; - - systemd.services.uni-sync = { - enable = true; - serviceConfig = { - ExecStart = "${pkgs.uni-sync}/bin/uni-sync"; - }; - wantedBy = ["multi-user.target"]; - }; - modules = { - nvidia.enable = true; - gaming.enable = true; - pipewire = { - enable = true; - latencyFix.enable = true; - }; - neovim.enable = true; - }; - - stylix.image = ../../wallpapers/lucy-edgerunners-wallpaper.jpg; + networking.hostName = "solaire"; + environment.variables.FLAKE = "/home/nezia/.dotfiles"; } diff --git a/hosts/vamos/default.nix b/hosts/vamos/default.nix index 96f74aa..aaeae31 100644 --- a/hosts/vamos/default.nix +++ b/hosts/vamos/default.nix @@ -1,27 +1,7 @@ -{inputs, ...}: { +{...}: { imports = [ ./hardware-configuration.nix - inputs.nixos-hardware.nixosModules.framework-13-7040-amd ]; - services = { - fprintd.enable = true; - power-profiles-daemon.enable = true; - keyd = { - enable = true; - keyboards = { - default = { - ids = ["*"]; - settings = { - main = { - capslock = "overload(control, esc)"; - }; - }; - }; - }; - }; - }; - modules = { - neovim.enable = true; - wezterm.enable = true; - }; + networking.hostName = "vamos"; + environment.variables.FLAKE = "/home/nezia/.dotfiles"; } diff --git a/modules/default.nix b/modules/default.nix deleted file mode 100644 index bd2cd6d..0000000 --- a/modules/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -_: { - imports = [ - ./gui - ./other - ./services - ./tui - ]; -} diff --git a/modules/gui/default.nix b/modules/gui/default.nix deleted file mode 100644 index 2950c16..0000000 --- a/modules/gui/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -_: { - imports = [ - ./gnome.nix - ./wezterm.nix - ]; -} diff --git a/modules/gui/floorp/default.nix b/modules/gui/floorp/default.nix deleted file mode 100644 index 734b78e..0000000 --- a/modules/gui/floorp/default.nix +++ /dev/null @@ -1,915 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; let - inherit (pkgs.stdenv.hostPlatform) isDarwin; - - cfg = config.programs.floorp; - - jsonFormat = pkgs.formats.json {}; - - floorpConfigPath = - if isDarwin - then "Library/Application Support/Floorp" - else "${config.home.homeDirectory}/.floorp"; - - profilesPath = - if isDarwin - then "${floorpConfigPath}/Profiles" - else floorpConfigPath; - - # The extensions path shared by all profiles; will not be supported - # by future Floorp versions. - extensionPath = "extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"; - - profiles = - flip mapAttrs' cfg.profiles (_: profile: - nameValuePair "Profile${toString profile.id}" { - Name = profile.name; - Path = - if isDarwin - then "Profiles/${profile.path}" - else profile.path; - IsRelative = 1; - Default = - if profile.isDefault - then 1 - else 0; - }) - // { - General = {StartWithLastProfile = 1;}; - }; - - profilesIni = generators.toINI {} profiles; - - userPrefValue = pref: - builtins.toJSON ( - if isBool pref || isInt pref || isString pref - then pref - else builtins.toJSON pref - ); - - mkUserJs = prefs: extraPrefs: bookmarks: let - prefs' = - lib.optionalAttrs ([] != bookmarks) { - "browser.bookmarks.file" = toString (floorpBookmarksFile bookmarks); - "browser.places.importBookmarksHTML" = true; - } - // prefs; - in '' - // Generated by Home Manager. - - ${concatStrings (mapAttrsToList (name: value: '' - user_pref("${name}", ${userPrefValue value}); - '') - prefs')} - - ${extraPrefs} - ''; - - mkContainersJson = containers: let - containerToIdentity = _: container: { - userContextId = container.id; - name = container.name; - icon = container.icon; - color = container.color; - public = true; - }; - in '' - ${builtins.toJSON { - version = 4; - lastUserContextId = - elemAt (mapAttrsToList (_: container: container.id) containers) 0; - identities = mapAttrsToList containerToIdentity containers; - }} - ''; - - floorpBookmarksFile = bookmarks: let - indent = level: - lib.concatStringsSep "" (map (lib.const " ") (lib.range 1 level)); - - bookmarkToHTML = indentLevel: bookmark: '' - ${indent indentLevel}
${escapeXML bookmark.name}''; - - directoryToHTML = indentLevel: directory: '' - ${indent indentLevel}
${ - if directory.toolbar - then '' -

Bookmarks Toolbar'' - else ''

${escapeXML directory.name}'' - }

- ${indent indentLevel}

- ${allItemsToHTML (indentLevel + 1) directory.bookmarks} - ${indent indentLevel}

''; - - itemToHTMLOrRecurse = indentLevel: item: - if item ? "url" - then bookmarkToHTML indentLevel item - else directoryToHTML indentLevel item; - - allItemsToHTML = indentLevel: bookmarks: - lib.concatStringsSep "\n" - (map (itemToHTMLOrRecurse indentLevel) bookmarks); - - bookmarkEntries = allItemsToHTML 1 bookmarks; - in - pkgs.writeText "floorp-bookmarks.html" '' - - - - Bookmarks -

Bookmarks Menu

-

- ${bookmarkEntries} -

- ''; - - mkNoDuplicateAssertion = entities: entityKind: (let - # Return an attribute set with entity IDs as keys and a list of - # entity names with corresponding ID as value. An ID is present in - # the result only if more than one entity has it. The argument - # entities is a list of AttrSet of one id/name pair. - findDuplicateIds = entities: - filterAttrs (_entityId: entityNames: length entityNames != 1) - (zipAttrs entities); - - duplicates = findDuplicateIds (mapAttrsToList - (entityName: entity: {"${toString entity.id}" = entityName;}) - entities); - - mkMsg = entityId: entityNames: - " - ID ${entityId} is used by " + concatStringsSep ", " entityNames; - in { - assertion = duplicates == {}; - message = - '' - Must not have a Floorp ${entityKind} with an existing ID but - '' - + concatStringsSep "\n" (mapAttrsToList mkMsg duplicates); - }); - - wrapPackage = package: let - # The configuration expected by the Floorp wrapper. - fcfg = {enableGnomeExtensions = cfg.enableGnomeExtensions;}; - - # A bit of hackery to force a config into the wrapper. - browserName = - package.browserName or (builtins.parseDrvName package.name).name; - - # The configuration expected by the Floorp wrapper builder. - bcfg = setAttrByPath [browserName] fcfg; - in - if package == null - then null - else if isDarwin - then package - else if versionAtLeast config.home.stateVersion "19.09" - then - package.override (old: { - cfg = old.cfg or {} // fcfg; - extraPolicies = cfg.policies; - }) - else (pkgs.wrapFloorp.override {config = bcfg;}) package {}; -in { - meta.maintainers = [maintainers.rycee maintainers.kira-bruneau]; - - imports = [ - (mkRemovedOptionModule ["programs" "floorp" "extensions"] '' - - Extensions are now managed per-profile. That is, change from - - programs.floorp.extensions = [ foo bar ]; - - to - - programs.floorp.profiles.myprofile.extensions = [ foo bar ];'') - (mkRemovedOptionModule ["programs" "floorp" "enableAdobeFlash"] - "Support for this option has been removed.") - (mkRemovedOptionModule ["programs" "floorp" "enableGoogleTalk"] - "Support for this option has been removed.") - (mkRemovedOptionModule ["programs" "floorp" "enableIcedTea"] - "Support for this option has been removed.") - ]; - - options = { - programs.floorp = { - enable = mkEnableOption "Floorp"; - - package = mkOption { - type = with types; nullOr package; - default = - if versionAtLeast config.home.stateVersion "19.09" - then pkgs.floorp - else pkgs.floorp-unwrapped; - defaultText = literalExpression "pkgs.floorp"; - example = literalExpression '' - pkgs.floorp.override { - # See nixpkgs' floorp/wrapper.nix to check which options you can use - nativeMessagingHosts = [ - # Gnome shell native connector - pkgs.gnome-browser-connector - # Tridactyl native connector - pkgs.tridactyl-native - ]; - } - ''; - description = '' - The Floorp package to use. If state version ≥ 19.09 then - this should be a wrapped Floorp package. For earlier state - versions it should be an unwrapped Floorp package. - Set to `null` to disable installing Floorp. - ''; - }; - - finalPackage = mkOption { - type = with types; nullOr package; - readOnly = true; - description = "Resulting Floorp package."; - }; - - policies = mkOption { - type = types.attrsOf jsonFormat.type; - default = {}; - description = "[See list of policies](https://mozilla.github.io/policy-templates/)."; - example = { - DefaultDownloadDirectory = "\${home}/Downloads"; - BlockAboutConfig = true; - }; - }; - - profiles = mkOption { - type = types.attrsOf (types.submodule ({ - config, - name, - ... - }: { - options = { - name = mkOption { - type = types.str; - default = name; - description = "Profile name."; - }; - - id = mkOption { - type = types.ints.unsigned; - default = 0; - description = '' - Profile ID. This should be set to a unique number per profile. - ''; - }; - - settings = mkOption { - type = types.attrsOf (jsonFormat.type - // { - description = "Floorp preference (int, bool, string, and also attrs, list, float as a JSON string)"; - }); - default = {}; - example = literalExpression '' - { - "browser.startup.homepage" = "https://nixos.org"; - "browser.search.region" = "GB"; - "browser.search.isUS" = false; - "distribution.searchplugins.defaultLocale" = "en-GB"; - "general.useragent.locale" = "en-GB"; - "browser.bookmarks.showMobileBookmarks" = true; - "browser.newtabpage.pinned" = [{ - title = "NixOS"; - url = "https://nixos.org"; - }]; - } - ''; - description = '' - Attribute set of Floorp preferences. - - Floorp only supports int, bool, and string types for - preferences, but home-manager will automatically - convert all other JSON-compatible values into strings. - ''; - }; - - extraConfig = mkOption { - type = types.lines; - default = ""; - description = '' - Extra preferences to add to {file}`user.js`. - ''; - }; - - userChrome = mkOption { - type = types.lines; - default = ""; - description = "Custom Floorp user chrome CSS."; - example = '' - /* Hide tab bar in FF Quantum */ - @-moz-document url("chrome://browser/content/browser.xul") { - #TabsToolbar { - visibility: collapse !important; - margin-bottom: 21px !important; - } - - #sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header { - visibility: collapse !important; - } - } - ''; - }; - - userContent = mkOption { - type = types.lines; - default = ""; - description = "Custom Floorp user content CSS."; - example = '' - /* Hide scrollbar in FF Quantum */ - *{scrollbar-width:none !important} - ''; - }; - - bookmarks = mkOption { - type = let - bookmarkSubmodule = - types.submodule ({ - config, - name, - ... - }: { - options = { - name = mkOption { - type = types.str; - default = name; - description = "Bookmark name."; - }; - - tags = mkOption { - type = types.listOf types.str; - default = []; - description = "Bookmark tags."; - }; - - keyword = mkOption { - type = types.nullOr types.str; - default = null; - description = "Bookmark search keyword."; - }; - - url = mkOption { - type = types.str; - description = "Bookmark url, use %s for search terms."; - }; - }; - }) - // { - description = "bookmark submodule"; - }; - - bookmarkType = types.addCheck bookmarkSubmodule (x: x ? "url"); - - directoryType = - types.submodule ({ - config, - name, - ... - }: { - options = { - name = mkOption { - type = types.str; - default = name; - description = "Directory name."; - }; - - bookmarks = mkOption { - type = types.listOf nodeType; - default = []; - description = "Bookmarks within directory."; - }; - - toolbar = mkOption { - type = types.bool; - default = false; - description = '' - Make this the toolbar directory. Note, this does _not_ - mean that this directory will be added to the toolbar, - this directory _is_ the toolbar. - ''; - }; - }; - }) - // { - description = "directory submodule"; - }; - - nodeType = types.either bookmarkType directoryType; - in - with types; - coercedTo (attrsOf nodeType) attrValues (listOf nodeType); - default = []; - example = literalExpression '' - [ - { - name = "wikipedia"; - tags = [ "wiki" ]; - keyword = "wiki"; - url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; - } - { - name = "kernel.org"; - url = "https://www.kernel.org"; - } - { - name = "Nix sites"; - toolbar = true; - bookmarks = [ - { - name = "homepage"; - url = "https://nixos.org/"; - } - { - name = "wiki"; - tags = [ "wiki" "nix" ]; - url = "https://nixos.wiki/"; - } - ]; - } - ] - ''; - description = '' - Preloaded bookmarks. Note, this may silently overwrite any - previously existing bookmarks! - ''; - }; - - path = mkOption { - type = types.str; - default = name; - description = "Profile path."; - }; - - isDefault = mkOption { - type = types.bool; - default = config.id == 0; - defaultText = "true if profile ID is 0"; - description = "Whether this is a default profile."; - }; - - search = { - force = mkOption { - type = with types; bool; - default = false; - description = '' - Whether to force replace the existing search - configuration. This is recommended since Floorp will - replace the symlink for the search configuration on every - launch, but note that you'll lose any existing - configuration by enabling this. - ''; - }; - - default = mkOption { - type = with types; nullOr str; - default = null; - example = "DuckDuckGo"; - description = '' - The default search engine used in the address bar and search bar. - ''; - }; - - privateDefault = mkOption { - type = with types; nullOr str; - default = null; - example = "DuckDuckGo"; - description = '' - The default search engine used in the Private Browsing. - ''; - }; - - order = mkOption { - type = with types; uniq (listOf str); - default = []; - example = ["DuckDuckGo" "Google"]; - description = '' - The order the search engines are listed in. Any engines - that aren't included in this list will be listed after - these in an unspecified order. - ''; - }; - - engines = mkOption { - type = with types; attrsOf (attrsOf jsonFormat.type); - default = {}; - example = literalExpression '' - { - "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; - - icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@np" ]; - }; - - "NixOS Wiki" = { - urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; - iconUpdateURL = "https://nixos.wiki/favicon.png"; - updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ "@nw" ]; - }; - - "Bing".metaData.hidden = true; - "Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias - } - ''; - description = '' - Attribute set of search engine configurations. Engines - that only have {var}`metaData` specified will - be treated as builtin to Floorp. - - See [SearchEngine.jsm](https://searchfox.org/mozilla-central/rev/669329e284f8e8e2bb28090617192ca9b4ef3380/toolkit/components/search/SearchEngine.jsm#1138-1177) - in Floorp's source for available options. We maintain a - mapping to let you specify all options in the referenced - link without underscores, but it may fall out of date with - future options. - - Note, {var}`icon` is also a special option - added by Home Manager to make it convenient to specify - absolute icon paths. - ''; - }; - }; - - containers = mkOption { - type = types.attrsOf (types.submodule ({name, ...}: { - options = { - name = mkOption { - type = types.str; - default = name; - description = "Container name, e.g., shopping."; - }; - - id = mkOption { - type = types.ints.unsigned; - default = 0; - description = '' - Container ID. This should be set to a unique number per container in this profile. - ''; - }; - - # List of colors at - # https://searchfox.org/mozilla-central/rev/5ad226c7379b0564c76dc3b54b44985356f94c5a/toolkit/components/extensions/parent/ext-contextualIdentities.js#32 - color = mkOption { - type = types.enum [ - "blue" - "turquoise" - "green" - "yellow" - "orange" - "red" - "pink" - "purple" - "toolbar" - ]; - default = "pink"; - description = "Container color."; - }; - - icon = mkOption { - type = types.enum [ - "briefcase" - "cart" - "circle" - "dollar" - "fence" - "fingerprint" - "gift" - "vacation" - "food" - "fruit" - "pet" - "tree" - "chill" - ]; - default = "fruit"; - description = "Container icon."; - }; - }; - })); - default = {}; - example = { - "shopping" = { - id = 1; - color = "blue"; - icon = "cart"; - }; - "dangerous" = { - id = 2; - color = "red"; - icon = "fruit"; - }; - }; - description = '' - Attribute set of container configurations. See - [Multi-Account - Containers](https://support.mozilla.org/en-US/kb/containers) - for more information. - ''; - }; - - extensions = mkOption { - type = types.listOf types.package; - default = []; - example = literalExpression '' - with pkgs.nur.repos.rycee.floorp-addons; [ - privacy-badger - ] - ''; - description = '' - List of Floorp add-on packages to install for this profile. - Some pre-packaged add-ons are accessible from the - [Nix User Repository](https://github.com/nix-community/NUR). - Once you have NUR installed run - - ```console - $ nix-env -f '' -qaP -A nur.repos.rycee.floorp-addons - ``` - - to list the available Floorp add-ons. - - Note that it is necessary to manually enable these extensions - inside Floorp after the first installation. - ''; - }; - }; - })); - default = {}; - description = "Attribute set of Floorp profiles."; - }; - - enableGnomeExtensions = mkOption { - type = types.bool; - default = false; - description = '' - Whether to enable the GNOME Shell native host connector. Note, you - also need to set the NixOS option - `services.gnome.gnome-browser-connector.enable` to - `true`. - ''; - }; - }; - }; - - config = mkIf cfg.enable { - assertions = - [ - (let - defaults = - catAttrs "name" (filter (a: a.isDefault) (attrValues cfg.profiles)); - in { - assertion = cfg.profiles == {} || length defaults == 1; - message = - "Must have exactly one default Floorp profile but found " - + toString (length defaults) - + optionalString (length defaults > 1) - (", namely " + concatStringsSep ", " defaults); - }) - - (mkNoDuplicateAssertion cfg.profiles "profile") - ] - ++ (mapAttrsToList - (_: profile: mkNoDuplicateAssertion profile.containers "container") - cfg.profiles); - - warnings = optional (cfg.enableGnomeExtensions or false) '' - Using 'programs.floorp.enableGnomeExtensions' has been deprecated and - will be removed in the future. Please change to overriding the package - configuration using 'programs.floorp.package' instead. You can refer to - its example for how to do this. - ''; - - programs.floorp.finalPackage = wrapPackage cfg.package; - - home.packages = lib.optional (cfg.finalPackage != null) cfg.finalPackage; - - home.file = mkMerge ([ - { - "${floorpConfigPath}/profiles.ini" = - mkIf (cfg.profiles != {}) {text = profilesIni;}; - } - ] - ++ flip mapAttrsToList cfg.profiles (_: profile: { - "${profilesPath}/${profile.path}/.keep".text = ""; - - "${profilesPath}/${profile.path}/chrome/userChrome.css" = - mkIf (profile.userChrome != "") {text = profile.userChrome;}; - - "${profilesPath}/${profile.path}/chrome/userContent.css" = - mkIf (profile.userContent != "") {text = profile.userContent;}; - - "${profilesPath}/${profile.path}/user.js" = mkIf (profile.settings - != {} - || profile.extraConfig != "" - || profile.bookmarks != []) { - text = - mkUserJs profile.settings profile.extraConfig profile.bookmarks; - }; - - "${profilesPath}/${profile.path}/containers.json" = mkIf (profile.containers != {}) { - text = mkContainersJson profile.containers; - }; - - "${profilesPath}/${profile.path}/search.json.mozlz4" = - mkIf - (profile.search.default - != null - || profile.search.privateDefault != null - || profile.search.order != [] - || profile.search.engines != {}) { - force = profile.search.force; - source = let - settings = { - version = 6; - engines = let - # Map of nice field names to internal field names. - # This is intended to be exhaustive and should be - # updated at every version bump. - internalFieldNames = - (genAttrs [ - "name" - "isAppProvided" - "loadPath" - "hasPreferredIcon" - "updateInterval" - "updateURL" - "iconUpdateURL" - "iconURL" - "iconMapObj" - "metaData" - "orderHint" - "definedAliases" - "urls" - ] (name: "_${name}")) - // { - searchForm = "__searchForm"; - }; - - processCustomEngineInput = input: - (removeAttrs input ["icon"]) - // optionalAttrs (input ? icon) { - # Convenience to specify absolute path to icon - iconURL = "file://${input.icon}"; - } - // (optionalAttrs (input ? iconUpdateURL) { - # Convenience to default iconURL to iconUpdateURL so - # the icon is immediately downloaded from the URL - iconURL = input.iconURL or input.iconUpdateURL; - } - // { - # Required for custom engine configurations, loadPaths - # are unique identifiers that are generally formatted - # like: [source]/path/to/engine.xml - loadPath = '' - [home-manager]/programs.floorp.profiles.${profile.name}.search.engines."${ - replaceStrings ["\\"] ["\\\\"] input.name - }"''; - }); - - processEngineInput = name: input: let - requiredInput = { - inherit name; - isAppProvided = - input.isAppProvided or removeAttrs input - ["metaData"] - == {}; - metaData = input.metaData or {}; - }; - in - if requiredInput.isAppProvided - then requiredInput - else processCustomEngineInput (input // requiredInput); - - buildEngineConfig = name: input: - mapAttrs' (name: value: { - name = internalFieldNames.${name} or name; - inherit value; - }) (processEngineInput name input); - - sortEngineConfigs = configs: let - buildEngineConfigWithOrder = order: name: let - config = - configs.${name} - or { - _name = name; - _isAppProvided = true; - _metaData = {}; - }; - in - config - // { - _metaData = config._metaData // {inherit order;}; - }; - - engineConfigsWithoutOrder = - attrValues (removeAttrs configs profile.search.order); - - sortedEngineConfigs = - (imap buildEngineConfigWithOrder profile.search.order) - ++ engineConfigsWithoutOrder; - in - sortedEngineConfigs; - - engineInput = - profile.search.engines - // { - # Infer profile.search.default as an app provided - # engine if it's not in profile.search.engines - ${profile.search.default} = - profile.search.engines.${profile.search.default} or {}; - } - // { - ${profile.search.privateDefault} = - profile.search.engines.${profile.search.privateDefault} or {}; - }; - in - sortEngineConfigs (mapAttrs buildEngineConfig engineInput); - - metaData = - optionalAttrs (profile.search.default != null) { - current = profile.search.default; - hash = "@hash@"; - } - // optionalAttrs (profile.search.privateDefault != null) { - private = profile.search.privateDefault; - privateHash = "@privateHash@"; - } - // { - useSavedOrder = profile.search.order != []; - }; - }; - - # Home Manager doesn't circumvent user consent and isn't acting - # maliciously. We're modifying the search outside of Floorp, but - # a claim by Mozilla to remove this would be very anti-user, and - # is unlikely to be an issue for our use case. - disclaimer = appName: - "By modifying this file, I agree that I am doing so " - + "only within ${appName} itself, using official, user-driven search " - + "engine selection processes, and in a way which does not circumvent " - + "user consent. I acknowledge that any attempt to change this file " - + "from outside of ${appName} is a malicious act, and will be responded " - + "to accordingly."; - - salt = - if profile.search.default != null - then profile.path + profile.search.default + disclaimer "Floorp" - else null; - - privateSalt = - if profile.search.privateDefault != null - then - profile.path - + profile.search.privateDefault - + disclaimer "Floorp" - else null; - in - pkgs.runCommand "search.json.mozlz4" { - nativeBuildInputs = with pkgs; [mozlz4a openssl]; - json = builtins.toJSON settings; - inherit salt privateSalt; - } '' - if [[ -n $salt ]]; then - export hash=$(echo -n "$salt" | openssl dgst -sha256 -binary | base64) - export privateHash=$(echo -n "$privateSalt" | openssl dgst -sha256 -binary | base64) - mozlz4a <(substituteStream json search.json.in --subst-var hash --subst-var privateHash) "$out" - else - mozlz4a <(echo "$json") "$out" - fi - ''; - }; - - "${profilesPath}/${profile.path}/extensions" = mkIf (profile.extensions != []) { - source = let - extensionsEnvPkg = pkgs.buildEnv { - name = "hm-floorp-extensions"; - paths = profile.extensions; - }; - in "${extensionsEnvPkg}/share/mozilla/${extensionPath}"; - recursive = true; - force = true; - }; - })); - }; -} diff --git a/modules/gui/gnome.nix b/modules/gui/gnome.nix deleted file mode 100644 index 997ba4c..0000000 --- a/modules/gui/gnome.nix +++ /dev/null @@ -1,140 +0,0 @@ -{ - config, - lib, - pkgs, - username, - ... -}: let - cfg = config.modules.gnome; - stylixEnabled = config.modules.stylix.enable or false; -in { - options = { - modules.gnome = { - enable = lib.mkEnableOption "Enable Gnome"; - }; - }; - config = lib.mkIf cfg.enable { - services.xserver = { - enable = true; - displayManager.gdm.enable = true; - desktopManager.gnome = { - enable = true; - extraGSettingsOverridePackages = [pkgs.mutter]; - extraGSettingsOverrides = '' - [org.gnome.mutter] - experimental-features=['scale-monitor-framebuffer'] - ''; - }; - }; - - environment.gnome.excludePackages = with pkgs; [ - gnome-console - gnome-photos - gnome-tour - gnome-software - iagno - hitori - atomix - gnome-contacts - gnome-initial-setup - gnome-music - gedit - cheese - tali - epiphany - geary - yelp - ]; - - environment.systemPackages = with pkgs; [ - gnome-tweaks - gnome-power-manager - rhythmbox - ]; - stylix = lib.mkIf stylixEnabled { - targets = { - plymouth.enable = false; - gtk.enable = false; - gnome.enable = false; - }; - fonts = { - sansSerif = { - package = pkgs.inter; - name = "Intel Variable"; - }; - serif = config.stylix.fonts.sansSerif; - }; - }; - home-manager.users.${username} = { - stylix = lib.mkIf stylixEnabled { - targets.gtk.enable = false; - }; - dconf = { - enable = true; - settings = { - "org/gnome/shell" = { - disable-user-extensions = false; # enables user extensions - enabled-extensions = [ - pkgs.gnomeExtensions.appindicator.extensionUuid - pkgs.gnomeExtensions.blur-my-shell.extensionUuid - pkgs.gnomeExtensions.emoji-copy.extensionUuid - pkgs.gnomeExtensions.clipboard-history.extensionUuid - ]; - }; - "org/gnome/desktop/input-sources" = { - xkb-options = ["compose:ralt"]; - }; - "org/gnome/desktop/interface" = { - enable-hot-corners = false; - }; - "org/gnome/desktop/search-providers" = { - disabled = [ - "org.gnome.Terminal.desktop" - "org.gnome.Software.desktop" - "org.gnome.seahorse.Application.desktop" - "org.gnome.clocks.desktop" - "org.gnome.Characters.desktop" - "org.gnome.Calendar.desktop" - "org.gnome.Calculator.desktop" - ]; - - enabled = [ - "org.gnome.Nautilus.desktop" - "org.gnome.Settings.desktop" - ]; - }; - "org/freedesktop/tracker/mine/files" = { - index-recursive-directories = [ - "&DESKTOP" - "&DOCUMENTS" - "&MUSIC" - "&PICTURES" - "&VIDEOS" - "/home/${username}/Notes" - "/home/${username}/Projects" - ]; - }; - }; - }; - home.packages = with pkgs.gnomeExtensions; [ - appindicator - blur-my-shell - clipboard-history - emoji-copy - ]; - programs.gnome-terminal = { - enable = true; - showMenubar = false; - profile = { - "4621184a-b921-42cf-80a0-7784516606f2" = { - default = true; - audibleBell = false; - allowBold = true; - visibleName = "${username}"; - font = "IntoneMono NF 14"; - }; - }; - }; - }; - }; -} diff --git a/modules/gui/wezterm.nix b/modules/gui/wezterm.nix deleted file mode 100644 index 85365a4..0000000 --- a/modules/gui/wezterm.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ - config, - lib, - username, - ... -}: let - cfg = config.modules.wezterm; -in { - options = { - modules.wezterm = { - enable = lib.mkEnableOption "enable wezterm"; - }; - }; - config = lib.mkIf cfg.enable { - home-manager.users.${username} = { - programs.wezterm = { - enable = true; - # package = inputs.wezterm.packages.${pkgs.system}.default; - extraConfig = '' - local w = require('wezterm') - - local function is_vim(pane) - return pane:get_user_vars().IS_NVIM == 'true' - end - - local direction_keys = { - h = 'Left', - j = 'Down', - k = 'Up', - l = 'Right', - } - - local function split_nav(resize_or_move, key) - return { - key = key, - mods = resize_or_move == 'resize' and 'META' or 'CTRL', - action = w.action_callback(function(win, pane) - if is_vim(pane) then - win:perform_action({ - SendKey = { key = key, mods = resize_or_move == 'resize' and 'META' or 'CTRL' }, - }, pane) - else - if resize_or_move == 'resize' then - win:perform_action({ AdjustPaneSize = { direction_keys[key], 3 } }, pane) - else - win:perform_action({ ActivatePaneDirection = direction_keys[key] }, pane) - end - end - end), - } - end - - return { - enable_wayland = false, - front_end = "WebGpu", - hide_tab_bar_if_only_one_tab = true, - show_new_tab_button_in_tab_bar = false, - harfbuzz_features = { "ss01", "ss03" }, - - leader = { key = " ", mods = "CTRL", timeout_milliseconds = 1000 }, - - keys = { - { - mods = "LEADER", - key = "-", - action = wezterm.action.SplitVertical { domain = "CurrentPaneDomain" } - }, - { - mods = "LEADER", - key = "=", - action = wezterm.action.SplitHorizontal { domain = "CurrentPaneDomain" } - }, - split_nav('move', 'h'), - split_nav('move', 'j'), - split_nav('move', 'k'), - split_nav('move', 'l'), - split_nav('resize', 'h'), - split_nav('resize', 'j'), - split_nav('resize', 'k'), - split_nav('resize', 'l'), - }, - } - ''; - }; - }; - }; -} diff --git a/modules/other/default.nix b/modules/other/default.nix deleted file mode 100644 index 70b3346..0000000 --- a/modules/other/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -_: { - imports = [ - ./gaming.nix - ./nvidia.nix - ./stylix.nix - ]; -} diff --git a/modules/other/gaming.nix b/modules/other/gaming.nix deleted file mode 100644 index 95665cd..0000000 --- a/modules/other/gaming.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ - lib, - config, - pkgs, - username, - ... -}: let - cfg = config.modules.gaming; -in { - options = { - modules.gaming = { - enable = lib.mkEnableOption "Enable the gaming module"; - }; - }; - - config = lib.mkIf cfg.enable { - programs = { - steam = { - enable = true; - gamescopeSession.enable = true; - }; - gamemode.enable = true; - coolercontrol = { - enable = true; - nvidiaSupport = true; - }; - }; - - hardware.keyboard.qmk.enable = true; - environment.systemPackages = with pkgs; [ - via - ]; - services.udev.packages = [pkgs.via]; - - home-manager.users.${username} = { - home.packages = with pkgs; [ - protonup-qt - bottles - lutris - path-of-building - r2modman - - # steamtinkerlaunch dependencies - unzip - xdotool - xorg.xwininfo - yad - ]; - programs.mangohud.enable = true; - }; - }; -} diff --git a/modules/other/nvidia.nix b/modules/other/nvidia.nix deleted file mode 100644 index 69120bb..0000000 --- a/modules/other/nvidia.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - config, - lib, - ... -}: let - cfg = config.modules.nvidia; -in { - options = { - modules.nvidia = { - enable = lib.mkEnableOption "Enable the Nvidia module"; - }; - }; - config = lib.mkIf cfg.enable { - services.xserver.videoDrivers = ["nvidia"]; - hardware.nvidia = { - # Modesetting is required. - modesetting.enable = true; - - # Nvidia power management. Experimental, and can cause sleep/suspend to fail. - # Enable this if you have graphical corruption issues or application crashes after waking - # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead - # of just the bare essentials. - 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; - - # Enable the Nvidia settings menu, - # accessible via `nvidia-settings`. - nvidiaSettings = true; - - # Optionally, you may need to select the appropriate driver version for your specific GPU. - package = config.boot.kernelPackages.nvidiaPackages.beta; - }; - }; -} diff --git a/modules/other/stylix.nix b/modules/other/stylix.nix deleted file mode 100644 index 72da748..0000000 --- a/modules/other/stylix.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: let - cfg = config.modules.stylix; -in { - options = { - modules.stylix = { - enable = lib.mkEnableOption "Enable the stylix module"; - }; - }; - config = lib.mkIf cfg.enable { - stylix = { - enable = true; - polarity = "dark"; - base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-frappe.yaml"; - cursor = { - package = pkgs.adwaita-icon-theme; - name = "Adwaita"; - size = 24; - }; - fonts = { - serif = lib.mkDefault { - package = pkgs.noto-fonts; - name = "Noto Serif"; - }; - sansSerif = lib.mkDefault { - package = pkgs.noto-fonts; - name = "Noto Sans"; - }; - monospace = lib.mkDefault { - package = pkgs.nerdfonts.override {fonts = ["IntelOneMono"];}; - name = "IntoneMono Nerd Font"; - }; - emoji = { - package = pkgs.noto-fonts-color-emoji; - name = "Noto Color Emoji"; - }; - sizes = lib.mkDefault { - terminal = 14; - applications = 10; - desktop = 10; - }; - }; - targets = { - gtk.enable = false; - gnome.enable = false; - }; - image = lib.mkDefault ../../wallpapers/nix-wallpaper-nineish-catppuccin-frappe-alt.svg; - }; - }; -} diff --git a/modules/services/default.nix b/modules/services/default.nix deleted file mode 100644 index db377c3..0000000 --- a/modules/services/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -_: { - imports = [ - ./docker.nix - ./pipewire.nix - ]; -} diff --git a/modules/services/docker.nix b/modules/services/docker.nix deleted file mode 100644 index 8374591..0000000 --- a/modules/services/docker.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - config, - lib, - username, - ... -}: let - cfg = config.modules.docker; -in { - options.modules.docker.enable = lib.mkEnableOption "docker module"; - config = lib.mkIf cfg.enable { - virtualisation.docker = { - enable = true; - rootless = { - enable = true; - setSocketVariable = true; - }; - }; - users.users.${username}.extraGroups = ["docker"]; - }; -} diff --git a/modules/services/pipewire.nix b/modules/services/pipewire.nix deleted file mode 100644 index 62a3da1..0000000 --- a/modules/services/pipewire.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - config, - lib, - ... -}: let - cfg = config.modules.pipewire; -in { - options.modules.pipewire.enable = lib.mkEnableOption "pipewire module"; - options.modules.pipewire.latencyFix.enable = lib.mkEnableOption "enable latency fixes"; - config = lib.mkIf cfg.enable { - hardware.pulseaudio.enable = false; - # rtkit is optional but recommended - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - }; - - services.pipewire.extraConfig.pipewire."92-low-latency" = lib.mkIf cfg.latencyFix.enable { - "context.properties" = { - "default.clock.rate" = 48000; - "default.clock.allowed-rates" = [48000]; - "default.clock.quantum" = 2048; - "default.clock.min-quantum" = 1024; - }; - }; - }; -} diff --git a/modules/tui/default.nix b/modules/tui/default.nix deleted file mode 100644 index d5187eb..0000000 --- a/modules/tui/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -_: { - imports = [ - ./neovim.nix - ]; -} diff --git a/modules/tui/neovim.nix b/modules/tui/neovim.nix deleted file mode 100644 index bc0e45b..0000000 --- a/modules/tui/neovim.nix +++ /dev/null @@ -1,134 +0,0 @@ -{ - config, - inputs, - lib, - pkgs, - username, - ... -}: let - cfg = config.modules.neovim; -in { - options.modules.neovim.enable = lib.mkEnableOption "neovim"; - - config = lib.mkIf cfg.enable { - environment.sessionVariables = { - EDITOR = "nvim"; - }; - - home-manager.users.${username} = { - imports = [inputs.nvf.homeManagerModules.default]; - - programs.nvf = { - enable = true; - settings.vim = { - viAlias = true; - vimAlias = true; - enableLuaLoader = true; - preventJunkFiles = true; - tabWidth = 4; - autoIndent = false; - useSystemClipboard = true; - - luaConfigPost = lib.concatStrings [ - '' - vim.opt.formatoptions:remove('c') - vim.opt.formatoptions:remove('r') - vim.opt.formatoptions:remove('o') - '' - ]; - - maps = { - normal = { - "m" = { - silent = true; - action = "make"; - }; # Same as nnoremap m make - "t" = { - silent = true; - action = "Neotree toggle"; - }; - }; - }; - theme = { - enable = true; - name = "catppuccin"; - style = "frappe"; - }; - - visuals = { - enable = true; - nvimWebDevicons.enable = true; - }; - - ui = { - noice.enable = true; - }; - notify.nvim-notify.enable = true; - - statusline.lualine = { - enable = true; - theme = "catppuccin"; - }; - - git.enable = true; - - lsp = { - enable = true; - lspSignature.enable = true; - lspconfig.enable = true; - formatOnSave = true; - mappings = { - addWorkspaceFolder = "wa"; - codeAction = "a"; - goToDeclaration = "gD"; - goToDefinition = "gd"; - hover = "K"; - listImplementations = "gi"; - listReferences = "gr"; - listWorkspaceFolders = "wl"; - nextDiagnostic = "k"; - previousDiagnostic = "j"; - openDiagnosticFloat = "e"; - removeWorkspaceFolder = "wr"; - renameSymbol = "r"; - signatureHelp = ""; - }; - }; - - autocomplete = { - enable = true; - alwaysComplete = true; - }; - - autopairs.enable = true; - languages = { - enableExtraDiagnostics = true; - enableFormat = true; - enableLSP = true; - enableTreesitter = true; - - nix.enable = true; - clang.enable = true; - python.enable = true; - }; - - treesitter = { - enable = true; - fold = true; - context.enable = true; - grammars = [ - pkgs.vimPlugins.nvim-treesitter.builtGrammars.nix - pkgs.vimPlugins.nvim-treesitter.builtGrammars.c - pkgs.vimPlugins.nvim-treesitter.builtGrammars.python - ]; - }; - - binds.whichKey.enable = true; - filetree.neo-tree.enable = true; - - telescope.enable = true; - }; - }; - }; - }; -} diff --git a/secrets/secrets.yaml b/secrets/secrets.yaml deleted file mode 100644 index 434edac..0000000 --- a/secrets/secrets.yaml +++ /dev/null @@ -1,29 +0,0 @@ -syncthing: - vamos: - key: ENC[AES256_GCM,data:scXcpelnAZdiGXDNhvLSuNKa9qVjBvmQtvYnuwK+WUobIPFCI5vQcj1xtgmBhb9+tLdOSj5vPjvXeR8m5iwAcm/GShAHgBOiR3eyLuUaOhKAcbQZ3Ev1YdaVH/znwVmYoOdE1QcEKflnfRUNftswu0cJrfeEdpEAMrEUWWip95ejbXIawxtX0jWsKaY7//8niogsU6LjR1pfjOR3zC2CzTtztyAmsiUj7KV4CR3AMSW6NYsHVxOB2CsrUBYCOvrgRKf5IOLC6UzN9y8nefnW/RzR5DOQgOeHpUCMqtVPgtIRFKI1uhr7Yv+vy/9jNDg4zi/+2FkDqSDu68sucgq2yMSQCa6Amv1WT40HYniiyVn+N5x1j2SfSnynrwoZFyK9,iv:6l/BJMkqK3sPkLllbp1hPQ2hcq34UGBYEwIYBFgXkWg=,tag:R06GXVQuBzNsH5SMZ/VY+w==,type:str] - cert: ENC[AES256_GCM,data:Nr1eE/6Mn1Migsl6whqr9iTuVCFoikQJB8QUFH85YKS+KphiXadKB/xwxhYqeuartDsdPusclsX5mjgoxmQwnwXyJLVJyVo3owXgFxhWd1OP3x2O1kIZ/4lbCDjDiGO5yASnkchvQyF6h/K+p+rZrGnfFtAiInZSaBTUUW8hlqRjh4DmNVh5ViVckquZMIZCWHMIchjiaoeW7twhSCuX5Oo72utsp6am1dBhWAlzXKeRdEBy9iwxC/fuOfS28rdOk9l5RQsoAaE5vaAV/IS2O0qi90ec0x+Rtta98thZKjXXW4nkjYDa3BLD5Xq89rl9W0D/HouWeE3eOOkka5kpp6hW1QvrL6vf8egwc//KqUssbwGXvKBri8fgFqVCwJMW38czAYz6rGNhieS23bP8BK4DFPbbRXkjFzDp1HyJEwyRRLvQmB/1+SY+spQpKFDn5QPvPvSHn2qRIZTU72jsEXw3IG1setTbwp289saxlT2Wu185rkfH/HlWpO8jFH3/Hap776cZ81fhDO2A2Giz1B276TFhftiAqxhmR59UKUyhwG4MHJqgaN23oVQhSbuGVEVXEcsopuc7vmZHUw2PB3F2UtsaxpP68Cprto9/oo3dkNbYl4KInHCFzXkKn5GzkSDAtsWD62OR0Qe3xeAG9Aunxg8gGLPTn5xzO99aS+jwcM5aaDRkzJ0qc/+7Mu74n8PQZUYDr73eDIPxv9Xh9uLw/AhqggmI/GcxynvsQQjcziGThchJz5OX+crGlf6ZpWETC44SDvaE/6RKS5VDy2hDGAb5q8jiQGp5PEQL+J4UR6ZsdTH7NWE+BGCQGH26ew+70+RjdLlDFtOolc5hFxRrB6FeLOPkP3VrmkkgJE3MaOfwDx8lJ6uETjfSxwGhxExx37giD7NICd1Vs+8Rfhz/P8V6DW5TIV9rziGlY8QbamaczDyhclntu39p0548Zbe9Ya8OGgxT62d7pLYn2Oz9debgU1BavBuYciOQvCZlqCqNRXNKVHLJRAprIyHFpHnKbSUbHTRXVm2ZE9uSeseMPMRILG3sYwA=,iv:FrCt2uSPQ5oXk+5FwA6S+mpHfoWky4ellvUtx6gxYLk=,tag:u9riwtZjP3v9Vsbb0ZIdQg==,type:str] - deviceId: ENC[AES256_GCM,data:mxnto9RbgeB5OvxfpK2Hlr8y3SrpgvVQ8GMPjD5h/QmS8anyI3ewL1ZlnBXUQAqAQkcTWKu0BWBv1bfnqpPS,iv:7D7MSbRxwspl7n4biK0DYRIKoedt2aCc2xrFaHSo2Zk=,tag:4LarA7Aq4+QwuJF5HVaBaw==,type:str] - solaire: - key: ENC[AES256_GCM,data:XB0OcDl98l0AoQVJJjy7RCAQEfXg2eOVYVdKm1AmROxfXqvCfCsdEPdFcq/C6GeDZZMG3pYOapF1fWG2uD7yqpKH2vzlL9yhv/hm7nbyhDCYeBtu8PGHVz8LR04xJZzON1nd+Y9lztAcvBhy0td8pey2YBlC718tGvR7AaKIULrFVA7xj8VdlPpR5ASvLmI6TFuDEyqUsDtNkpcI5BhWpj4y49qpWID0uMi52Tw8bXYn1XOdITYI4ncJawCDE+VEVUYehe9U92eISMNKyV7SPzq7DNdKSpzObVlt971rhqN9SAjnilRRMDAlWuQ/M5t/4bmZTPehry+2xEBMWdv+2GbdgcEmtisxV9TQYHROAJq3okUlfKX5gvyU3VMFeukB,iv:+HShUZ2KdPEUT4dQda/kt9L320G/e1Qfbch6qu5oIM4=,tag:MClNH/PoSQ4SYQ5ecwkyCg==,type:str] - cert: ENC[AES256_GCM,data:UpwKCK602rEkDvSQHnKjipd3vvKsBnWO4k2r+L+dvhVsiGQvDYu2Dt0BQ8/RXBv9Vl9aQwu2ZCDnCztxLizjWpUjELVaf2+tAIJc/NUGBzCRLTxYVKL98vYDvg3r+JXlceK2S9jWr1CSzh/uqXLYsWLvE+gG8WjUtBxbVoyS9/MMf9hLxXZlhjR5mMKuCyeFk7aNA8su2rnm7lX/4IfgUQu9u28Eu8NswfnuycCxv560fqGHnyniID6/PQ7ME9g4Ldn5H6SQLeBF7d70kbVjwNlcBm0uRbFdaQEpFt02JrcTZN1DxXCaeOkkC15v/ShqKL0XGFxhwDiOQ9iKP6GWWWDZMMgyILFE3g3Td9M5fOFt5fmI/i8+/Jw64p2IK7A1I97Pm+Q9rU2uc4wrq0xXOYhMM/ljrg7PUZtFeixL+PdAuVtdGBtKVhH3r49TpCqSqMNfxri2SMiB+Aoc5w6zkGjTImqdWXoy9hlaI/kFk+8xMFIE3xIT+kv3RLqtQFHWeMM8PmjGoJkgw90mZ06A/b2iZ5GtPukKKMxCqDV5P21K/ExBVe2qMB+BsLsWoXHxkFDdFv/eHfpKfpPW5ZlK3/RAmw/Pf5AJj5W/J3qhX1/qmM9CMcGjyhOhplacONb76BoZfkpaycufnr6f+U+3NlxUJ07XRG00J66qxBs/n+NNAdtvuwYGkakGhbpZJq3BkXSovzlJQ32nKN0CkM/xTxsPj0xDn8Ff+NVt/3EDYlz5rff6qm7YZPB0LwZy18eypfeRtYhINx4bN6sKkIxLFOrcabW0T1Snq22UtfKlq7D2LUVgOOXXsaHmm1Dv1ysMM2Vy/lIYipzSL8J8sXKiVeTHbnDJ8PZshbKOwFC40QMk6UCcjvzW1kFwgqixVMnh/qJtBfApC+Tt9dwKtWwLernWmb2nCn1R+jnDfl905oHa4gMxZk4V3gsXtgoxGV2rw9Upbvp7bZjcp9yRgppnZvvm4/3AjccVbtaZPQlRMIMxDtF2FaJO4xn14tKs+F+ezri6jQBnuMk43FdugS/RfoZzgHYxrZ6o4D4=,iv:LzOUhtGQqvDYz2d3odQl79NISW0R5yHdnGnyCKtZClQ=,tag:3s+hvTZ2LR0O3PmcCH/Y6A==,type:str] - deviceId: ENC[AES256_GCM,data:Esj/3kZyg2HRP8h2RGv7/52TT2kAyOYN/LG3itRF51u6BagSKtmONmdJqmQ0GaXRHJIWAu/vCiP4u8h2OFmt,iv:G7r53MRmahA6x1sgLWZ3jBQ8pN0A3x9RR8QhD+++H9E=,tag:GPr7Vl2QQjlsxvKm2jpwig==,type:str] -sops: - kms: [] - gcp_kms: [] - azure_kv: [] - hc_vault: [] - age: - - recipient: age1mvdgtkaz4ttp8cp9uf7en22fs06xl7823sjpudw6yw8525ykeews9c5x34 - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBPT0RJNGdCcHh0U1FIL2Zv - OStzbEYzV2ZvZWpuRVJTMG5LSzZFcExJWUdNCjN6K1BFdWpyNElUWmpQc08wRkd3 - VzRJWHlicmxBellXaVl6N3pZZDJMa2sKLS0tIHpSTmRIbGlSWUJQNjZZLytuaUNz - cWRVSWR1TDFOaVhDbDhzQnNnaS80Vm8Kd8DzT7uRneMOVngA3XC/WIbhaSNzWbCQ - KwngtMhFTh+hvLKUYkA189La4TfXKfjmcGF6/vxwZ9N5vHLQ9cm5Nw== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-08-25T20:35:09Z" - mac: ENC[AES256_GCM,data:5iyIoWNMXonK5RuTyMjgbFqzSuYM3aZdN0TABQ4ETkP6nOQ15k8xRxz5vah4OPK5hY7Qp3ZBIK0D/Qb0lgsg7TmaMkPkCdKyFL2DYxFxKIzZhbbZ62Gy3uQ4xOBXgEHWQ6RmMnIxFdytROO/7ValdnSUdEXWVvLoBMjh59IgrIU=,iv:/KR5YdMdjxD8h7+IWMsQFhVpnsqc4WoNeN8RnqmV6pA=,tag:RiJ+/Suu1UINZzIk9WK3Zg==,type:str] - pgp: [] - unencrypted_suffix: _unencrypted - version: 3.9.0 diff --git a/hosts/common/system/boot.nix b/system/core/boot.nix similarity index 100% rename from hosts/common/system/boot.nix rename to system/core/boot.nix diff --git a/system/core/default.nix b/system/core/default.nix new file mode 100644 index 0000000..a5e2c10 --- /dev/null +++ b/system/core/default.nix @@ -0,0 +1,25 @@ +{lib, ...}: { + imports = [ + ./boot.nix + ./users.nix + ../nix + ]; + i18n = { + defaultLocale = "en_US.UTF-8"; + extraLocaleSettings = { + LC_ADDRESS = "fr_CH.UTF-8"; + LC_IDENTIFICATION = "fr_CH.UTF-8"; + LC_MEASUREMENT = "fr_CH.UTF-8"; + LC_MONETARY = "fr_CH.UTF-8"; + LC_NAME = "fr_CH.UTF-8"; + LC_NUMERIC = "fr_CH.UTF-8"; + LC_PAPER = "fr_CH.UTF-8"; + LC_TELEPHONE = "fr_CH.UTF-8"; + LC_TIME = "fr_CH.UTF-8"; + }; + }; + + system.stateVersion = lib.mkDefault "24.05"; + time.timeZone = lib.mkDefault "Europe/Paris"; + zramSwap.enable = true; +} diff --git a/system/core/users.nix b/system/core/users.nix new file mode 100644 index 0000000..24bb86b --- /dev/null +++ b/system/core/users.nix @@ -0,0 +1,10 @@ +{...}: { + users.users.nezia = { + isNormalUser = true; + description = "Anthony Rodriguez"; + extraGroups = [ + "networkmanager" + "wheel" + ]; + }; +} diff --git a/system/default.nix b/system/default.nix new file mode 100644 index 0000000..3c32ff4 --- /dev/null +++ b/system/default.nix @@ -0,0 +1,28 @@ +let + common = [ + ./core + ./hardware/printing.nix + ./hardware/fwupd.nix + + ./network + + ./programs + + ./services + ]; + desktop = + common + ++ [ + ./hardware/uni-sync.nix + ]; + + laptop = + desktop + ++ [ + ./hardware/power.nix + ./hardware/fprintd.nix + ./services/keyd.nix + ]; +in { + inherit desktop laptop; +} diff --git a/system/hardware/fprintd.nix b/system/hardware/fprintd.nix new file mode 100644 index 0000000..366fa60 --- /dev/null +++ b/system/hardware/fprintd.nix @@ -0,0 +1,3 @@ +{ + services.fprintd.enable = true; +} diff --git a/system/hardware/fwupd.nix b/system/hardware/fwupd.nix new file mode 100644 index 0000000..a62f709 --- /dev/null +++ b/system/hardware/fwupd.nix @@ -0,0 +1,3 @@ +{ + services.fwupd.enable = true; +} diff --git a/system/hardware/nvidia.nix b/system/hardware/nvidia.nix new file mode 100644 index 0000000..b970fde --- /dev/null +++ b/system/hardware/nvidia.nix @@ -0,0 +1,33 @@ +{config, ...}: { + services.xserver.videoDrivers = ["nvidia"]; + hardware.nvidia = { + # Modesetting is required. + modesetting.enable = true; + + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + # Enable this if you have graphical corruption issues or application crashes after waking + # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead + # of just the bare essentials. + 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; + + # Enable the Nvidia settings menu, + # accessible via `nvidia-settings`. + nvidiaSettings = true; + + # Optionally, you may need to select the appropriate driver version for your specific GPU. + package = config.boot.kernelPackages.nvidiaPackages.beta; + }; +} diff --git a/system/hardware/power.nix b/system/hardware/power.nix new file mode 100644 index 0000000..dd79035 --- /dev/null +++ b/system/hardware/power.nix @@ -0,0 +1,3 @@ +{ + services.power-profiles-daemon.enable = true; +} diff --git a/hosts/common/system/printing.nix b/system/hardware/printing.nix similarity index 100% rename from hosts/common/system/printing.nix rename to system/hardware/printing.nix diff --git a/system/hardware/uni-sync.nix b/system/hardware/uni-sync.nix new file mode 100644 index 0000000..41c238d --- /dev/null +++ b/system/hardware/uni-sync.nix @@ -0,0 +1,37 @@ +{pkgs, ...}: { + hardware.uni-sync = { + enable = true; + devices = [ + { + device_id = "VID:3314/PID:41218/SN:6243168001"; + sync_rgb = true; + channels = [ + { + mode = "Manual"; + speed = 60; + } + { + mode = "Manual"; + speed = 60; + } + { + mode = "Manual"; + speed = 60; + } + { + mode = "Manual"; + speed = 60; + } + ]; + } + ]; + }; + + systemd.services.uni-sync = { + enable = true; + serviceConfig = { + ExecStart = "${pkgs.uni-sync}/bin/uni-sync"; + }; + wantedBy = ["multi-user.target"]; + }; +} diff --git a/system/hardware/via.nix b/system/hardware/via.nix new file mode 100644 index 0000000..05c1c48 --- /dev/null +++ b/system/hardware/via.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + hardware.keyboard.qmk.enable = true; + environment.systemPackages = with pkgs; [ + via + ]; + services.udev.packages = [pkgs.via]; +} diff --git a/system/network/default.nix b/system/network/default.nix new file mode 100644 index 0000000..ace8d35 --- /dev/null +++ b/system/network/default.nix @@ -0,0 +1,13 @@ +{ + networking = { + networkmanager = { + enable = true; + dns = "systemd-resolved"; + wifi.powersave = true; + }; + }; + services.resolved = { + enable = true; + dnsovertls = "opportunistic"; + }; +} diff --git a/system/nix/default.nix b/system/nix/default.nix new file mode 100644 index 0000000..3684f91 --- /dev/null +++ b/system/nix/default.nix @@ -0,0 +1,14 @@ +{pkgs, ...}: { + imports = [./nixpkgs.nix ./nh.nix]; + environment.systemPackages = [pkgs.git]; + nix = { + package = pkgs.lix; + settings = { + auto-optimise-store = true; + experimental-features = [ + "nix-command" + "flakes" + ]; + }; + }; +} diff --git a/system/nix/nh.nix b/system/nix/nh.nix new file mode 100644 index 0000000..d6508cf --- /dev/null +++ b/system/nix/nh.nix @@ -0,0 +1,9 @@ +{ + programs.nh = { + enable = true; + clean = { + enable = true; + extraArgs = "--keep-since 30d --keep 3"; + }; + }; +} diff --git a/system/nix/nixpkgs.nix b/system/nix/nixpkgs.nix new file mode 100644 index 0000000..e95ec3c --- /dev/null +++ b/system/nix/nixpkgs.nix @@ -0,0 +1,3 @@ +{ + nixpkgs.config.allowUnfree = true; +} diff --git a/system/programs/default.nix b/system/programs/default.nix new file mode 100644 index 0000000..1193262 --- /dev/null +++ b/system/programs/default.nix @@ -0,0 +1,10 @@ +{ + imports = [ + ./fonts.nix + ./home-manager.nix + ]; + programs = { + # make HM-managed GTK stuff work + dconf.enable = true; + }; +} diff --git a/system/programs/fonts.nix b/system/programs/fonts.nix new file mode 100644 index 0000000..8d80d9e --- /dev/null +++ b/system/programs/fonts.nix @@ -0,0 +1,21 @@ +{pkgs, ...}: { + fonts = { + packages = with pkgs; [ + noto-fonts + noto-fonts-emoji + intel-one-mono + (nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];}) + ]; + enableDefaultPackages = false; + + fontconfig.defaultFonts = let + addAll = builtins.mapAttrs (_: v: ["Symbols Nerd Font"] ++ v ++ ["Noto Color Emoji"]); + in + addAll { + serif = ["Noto Serif"]; + sansSerif = ["Inter"]; + monospace = ["Intel One Mono"]; + emoji = []; + }; + }; +} diff --git a/system/programs/gamemode.nix b/system/programs/gamemode.nix new file mode 100644 index 0000000..a411255 --- /dev/null +++ b/system/programs/gamemode.nix @@ -0,0 +1,11 @@ +{inputs, ...}: { + programs.gamemode = { + enable = true; + settings = { + general = { + softrealtime = "auto"; + renice = 15; + }; + }; + }; +} diff --git a/system/programs/games.nix b/system/programs/games.nix new file mode 100644 index 0000000..9b43fbe --- /dev/null +++ b/system/programs/games.nix @@ -0,0 +1,16 @@ +{pkgs, ...}: { + programs = { + steam = { + enable = true; + gamescopeSession.enable = true; + extraCompatPackages = [ + pkgs.proton-ge-bin + ]; + }; + gamemode.enable = true; + coolercontrol = { + enable = true; + nvidiaSupport = true; + }; + }; +} diff --git a/system/programs/gnome.nix b/system/programs/gnome.nix new file mode 100644 index 0000000..78fb01f --- /dev/null +++ b/system/programs/gnome.nix @@ -0,0 +1,39 @@ +{pkgs, ...}: { + services.xserver = { + enable = true; + displayManager.gdm.enable = true; + desktopManager.gnome = { + enable = true; + extraGSettingsOverridePackages = [pkgs.mutter]; + extraGSettingsOverrides = '' + [org.gnome.mutter] + experimental-features=['scale-monitor-framebuffer'] + ''; + }; + }; + + environment.gnome.excludePackages = with pkgs; [ + gnome-console + gnome-photos + gnome-tour + gnome-software + iagno + hitori + atomix + gnome-contacts + gnome-initial-setup + gnome-music + gedit + cheese + tali + epiphany + geary + yelp + ]; + + environment.systemPackages = with pkgs; [ + gnome-tweaks + gnome-power-manager + rhythmbox + ]; +} diff --git a/system/programs/home-manager.nix b/system/programs/home-manager.nix new file mode 100644 index 0000000..216ffe2 --- /dev/null +++ b/system/programs/home-manager.nix @@ -0,0 +1,10 @@ +{inputs, ...}: { + imports = [ + inputs.home-manager.nixosModules.default + ]; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + }; +} diff --git a/system/services/default.nix b/system/services/default.nix new file mode 100644 index 0000000..8eb522a --- /dev/null +++ b/system/services/default.nix @@ -0,0 +1,3 @@ +{ + imports = [./docker.nix ./gnupg.nix ./pipewire.nix]; +} diff --git a/system/services/docker.nix b/system/services/docker.nix new file mode 100644 index 0000000..7d9b22d --- /dev/null +++ b/system/services/docker.nix @@ -0,0 +1,9 @@ +_: { + virtualisation.docker = { + enable = true; + rootless = { + enable = true; + setSocketVariable = true; + }; + }; +} diff --git a/system/services/gnupg.nix b/system/services/gnupg.nix new file mode 100644 index 0000000..5785e22 --- /dev/null +++ b/system/services/gnupg.nix @@ -0,0 +1,6 @@ +{ + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; +} diff --git a/system/services/keyd.nix b/system/services/keyd.nix new file mode 100644 index 0000000..27a47b5 --- /dev/null +++ b/system/services/keyd.nix @@ -0,0 +1,17 @@ +{ + services = { + keyd = { + enable = true; + keyboards = { + default = { + ids = ["*"]; + settings = { + main = { + capslock = "overload(control, esc)"; + }; + }; + }; + }; + }; + }; +} diff --git a/system/services/pipewire.nix b/system/services/pipewire.nix new file mode 100644 index 0000000..9a9a78d --- /dev/null +++ b/system/services/pipewire.nix @@ -0,0 +1,22 @@ +_: { + hardware.pulseaudio.enable = false; + # rtkit is optional but recommended + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + }; + + services.pipewire.extraConfig.pipewire."92-low-latency" = { + "context.properties" = { + "default.clock.rate" = 48000; + "default.clock.allowed-rates" = [48000]; + "default.clock.quantum" = 2048; + "default.clock.min-quantum" = 1024; + }; + }; +} diff --git a/system/syncthing/default.nix b/system/syncthing/default.nix new file mode 100644 index 0000000..4e16097 --- /dev/null +++ b/system/syncthing/default.nix @@ -0,0 +1,8 @@ +{ + services = { + syncthing = { + enable = true; + systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true"; # Don't create default ~/Sync folder + }; + }; +}