From 20b64f5707c6abf2e12d8c8b5519e7a25d06165f Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 6 Jun 2024 18:13:16 +0100 Subject: [PATCH 1/6] pyprland and scratchpads --- ] | 33 ++++ flake.nix | 175 +++++++++--------- .../optional/desktop/hyprland/default.nix | 9 +- .../optional/desktop/hyprland/pyprland.nix | 33 ++++ .../optional/desktop/wayland/default.nix | 1 + .../optional/desktop/wayland/waybar.nix | 2 +- 6 files changed, 165 insertions(+), 88 deletions(-) create mode 100644 ] create mode 100644 home/common/optional/desktop/hyprland/pyprland.nix diff --git a/] b/] new file mode 100644 index 0000000..167448c --- /dev/null +++ b/] @@ -0,0 +1,33 @@ +{ ... }: +{ + home.file.".config/hypr/pyprland.toml".text = '' + [pyprland] + plugins = [ + "scratchpads" + ] + + [scratchpads.termy] + animation = "fromTop" + command = "$TERMINAL --class $TERMINAL-dropterm-y --title 'Scratchpad(y)'" + class = "$TERMINAL-dropterm-y" + size = "70% 70%" + + [scratchpads.termu] + animation = "fromTop" + command = "$TERMINAL --class $TERMINAL-dropterm-u --title 'Scratchpad(u)'" + class = "$TERMINAL-dropterm-u" + size = "80% 80%" + + [scratchpads.termi] + animation = "fromTop" + command = "$TERMINAL --class $TERMINAL-dropterm-i --title 'Scratchpad(i)'" + class = "$TERMINAL-dropterm-i" + size = "50% 50%" + + [scratchpads.volume] + animation = "fromTop" + command = "pavucontrol --class floating" + class = "org.pulseaudio.pavucontrol" + size = "75% 60%" + ''; +} diff --git a/flake.nix b/flake.nix index ef35c23..e528699 100644 --- a/flake.nix +++ b/flake.nix @@ -48,92 +48,97 @@ }; }; - outputs = { - self, - nixpkgs, - home-manager, - ... - } @ inputs: - let - inherit (self) outputs; - systems = [ - "x86_64-linux" - ]; - forAllSystems = nixpkgs.lib.genAttrs systems; - specialArgs = { inherit inputs outputs; }; - in { - packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); - formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); - overlays = import ./overlays {inherit inputs;}; - nixosModules = import ./modules/nixos; - homeManagerModules = import ./modules/home-manager; + outputs = + { self + , nixpkgs + , home-manager + , ... + } @ inputs: + let + inherit (self) outputs; + systems = [ + "x86_64-linux" + ]; + forAllSystems = nixpkgs.lib.genAttrs systems; + specialArgs = { inherit inputs outputs; }; + in + { + packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); + overlays = import ./overlays { inherit inputs; }; + nixosModules = import ./modules/nixos; + homeManagerModules = import ./modules/home-manager; - # System level configs - nixosConfigurations = { - nixdev = nixpkgs.lib.nixosSystem { - inherit specialArgs; - modules = [ - ./hosts/nixdev - home-manager.nixosModules.home-manager{ - home-manager.extraSpecialArgs = specialArgs; - } - ]; - }; - fileserver = nixpkgs.lib.nixosSystem { - inherit specialArgs; - modules = [ - ./hosts/fileserver - home-manager.nixosModules.home-manager{ - home-manager.extraSpecialArgs = specialArgs; - } - ]; - }; - bootstrap = nixpkgs.lib.nixosSystem { - inherit specialArgs; - modules = [ - ./hosts/bootstrap - ]; - }; - sparky = nixpkgs.lib.nixosSystem { - inherit specialArgs; - modules = [ - ./hosts/sparky - home-manager.nixosModules.home-manager{ - home-manager.extraSpecialArgs = specialArgs; - } - ]; - }; - semita = nixpkgs.lib.nixosSystem { - inherit specialArgs; - modules = [ - ./hosts/semita - home-manager.nixosModules.home-manager{ - home-manager.extraSpecialArgs = specialArgs; - } - ]; + # System level configs + nixosConfigurations = { + nixdev = nixpkgs.lib.nixosSystem { + inherit specialArgs; + modules = [ + ./hosts/nixdev + home-manager.nixosModules.home-manager + { + home-manager.extraSpecialArgs = specialArgs; + } + ]; + }; + fileserver = nixpkgs.lib.nixosSystem { + inherit specialArgs; + modules = [ + ./hosts/fileserver + home-manager.nixosModules.home-manager + { + home-manager.extraSpecialArgs = specialArgs; + } + ]; + }; + bootstrap = nixpkgs.lib.nixosSystem { + inherit specialArgs; + modules = [ + ./hosts/bootstrap + ]; + }; + sparky = nixpkgs.lib.nixosSystem { + inherit specialArgs; + modules = [ + ./hosts/sparky + home-manager.nixosModules.home-manager + { + home-manager.extraSpecialArgs = specialArgs; + } + ]; + }; + semita = nixpkgs.lib.nixosSystem { + inherit specialArgs; + modules = [ + ./hosts/semita + home-manager.nixosModules.home-manager + { + home-manager.extraSpecialArgs = specialArgs; + } + ]; + }; }; + + # # Standalone home-manager configuration entrypoint + # # Available through 'home-manager --flake .#your-username@your-hostname' + # homeConfigurations = { + # # FIXME replace with your username@hostname + # "sam@nixdev" = home-manager.lib.homeManagerConfiguration { + # pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance + # extraSpecialArgs = {inherit inputs outputs ;}; + # modules = [ + # # > Our main home-manager configuration file < + # ./home/nixdev.nix + # ]; + # }; + # "admin@fileserver" = home-manager.lib.homeManagerConfiguration { + # pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance + # extraSpecialArgs = {inherit inputs outputs ;}; + # modules = [ + # # > Our main home-manager configuration file < + # ./home/nixdev.nix + # ]; + # }; + # }; }; - -# # Standalone home-manager configuration entrypoint -# # Available through 'home-manager --flake .#your-username@your-hostname' -# homeConfigurations = { -# # FIXME replace with your username@hostname -# "sam@nixdev" = home-manager.lib.homeManagerConfiguration { -# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance -# extraSpecialArgs = {inherit inputs outputs ;}; -# modules = [ -# # > Our main home-manager configuration file < -# ./home/nixdev.nix -# ]; -# }; -# "admin@fileserver" = home-manager.lib.homeManagerConfiguration { -# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance -# extraSpecialArgs = {inherit inputs outputs ;}; -# modules = [ -# # > Our main home-manager configuration file < -# ./home/nixdev.nix -# ]; -# }; -# }; - }; } diff --git a/home/common/optional/desktop/hyprland/default.nix b/home/common/optional/desktop/hyprland/default.nix index 524fd37..563323c 100644 --- a/home/common/optional/desktop/hyprland/default.nix +++ b/home/common/optional/desktop/hyprland/default.nix @@ -7,6 +7,7 @@ imports = [ ../common ../wayland + ./pyprland.nix ]; wayland.windowManager.hyprland = { enable = true; @@ -108,7 +109,7 @@ sensitivity = -0.5 } - + windowrulev2 = float, class:floating $mainMod = SUPER @@ -119,6 +120,10 @@ bind = $mainMod, V, togglefloating, bind = $mainMod, R, exec, $menu + bind = $mainMod, y, exec, pypr toggle termy + bind = $mainMod, u, exec, pypr toggle termu + bind = $mainMod, i, exec, pypr toggle termi + bind = $mainMod, h, movefocus, l bind = $mainMod, l, movefocus, r bind = $mainMod, k, movefocus, u @@ -155,7 +160,7 @@ bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow - exec-once=swww-wallpaper-changer + exec-once=swww-wallpaper-changer & pypr ''; }; } diff --git a/home/common/optional/desktop/hyprland/pyprland.nix b/home/common/optional/desktop/hyprland/pyprland.nix new file mode 100644 index 0000000..2094dba --- /dev/null +++ b/home/common/optional/desktop/hyprland/pyprland.nix @@ -0,0 +1,33 @@ +{ ... }: +{ + home.file.".config/hypr/pyprland.toml".text = '' + [pyprland] + plugins = [ + "scratchpads" + ] + + [scratchpads.termy] + animation = "fromTop" + command = "$TERMINAL --class $TERMINAL-dropterm-y --title 'Scratchpad(y)'" + class = "$TERMINAL-dropterm-y" + size = "80% 80%" + + [scratchpads.termu] + animation = "fromTop" + command = "$TERMINAL --class $TERMINAL-dropterm-u --title 'Scratchpad(u)'" + class = "$TERMINAL-dropterm-u" + size = "80% 80%" + + [scratchpads.termi] + animation = "fromTop" + command = "$TERMINAL --class $TERMINAL-dropterm-i --title 'Scratchpad(i)'" + class = "$TERMINAL-dropterm-i" + size = "80% 80%" + + [scratchpads.volume] + animation = "fromTop" + command = "pavucontrol --class floating" + class = "org.pulseaudio.pavucontrol" + size = "75% 60%" + ''; +} diff --git a/home/common/optional/desktop/wayland/default.nix b/home/common/optional/desktop/wayland/default.nix index c7e1bc7..196bc79 100644 --- a/home/common/optional/desktop/wayland/default.nix +++ b/home/common/optional/desktop/wayland/default.nix @@ -9,5 +9,6 @@ home.packages = [ pkgs.wofi pkgs.wl-clipboard + pkgs.pyprland ]; } diff --git a/home/common/optional/desktop/wayland/waybar.nix b/home/common/optional/desktop/wayland/waybar.nix index d32118e..9c92604 100644 --- a/home/common/optional/desktop/wayland/waybar.nix +++ b/home/common/optional/desktop/wayland/waybar.nix @@ -130,7 +130,7 @@ "portable" = ""; "default" = [ "" "" "" ]; }; - "on-click" = "pavucontrol"; + "on-click" = "pypr toggle volume"; }; }; From 44f940837238d6c322edf2b371bda27066a56d52 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 6 Jun 2024 18:15:59 +0100 Subject: [PATCH 2/6] nixvim theme disable dim inactive view --- ] | 33 ------------------------------- home/common/core/nixvim/theme.nix | 1 - 2 files changed, 34 deletions(-) delete mode 100644 ] diff --git a/] b/] deleted file mode 100644 index 167448c..0000000 --- a/] +++ /dev/null @@ -1,33 +0,0 @@ -{ ... }: -{ - home.file.".config/hypr/pyprland.toml".text = '' - [pyprland] - plugins = [ - "scratchpads" - ] - - [scratchpads.termy] - animation = "fromTop" - command = "$TERMINAL --class $TERMINAL-dropterm-y --title 'Scratchpad(y)'" - class = "$TERMINAL-dropterm-y" - size = "70% 70%" - - [scratchpads.termu] - animation = "fromTop" - command = "$TERMINAL --class $TERMINAL-dropterm-u --title 'Scratchpad(u)'" - class = "$TERMINAL-dropterm-u" - size = "80% 80%" - - [scratchpads.termi] - animation = "fromTop" - command = "$TERMINAL --class $TERMINAL-dropterm-i --title 'Scratchpad(i)'" - class = "$TERMINAL-dropterm-i" - size = "50% 50%" - - [scratchpads.volume] - animation = "fromTop" - command = "pavucontrol --class floating" - class = "org.pulseaudio.pavucontrol" - size = "75% 60%" - ''; -} diff --git a/home/common/core/nixvim/theme.nix b/home/common/core/nixvim/theme.nix index 7dd7112..445f962 100644 --- a/home/common/core/nixvim/theme.nix +++ b/home/common/core/nixvim/theme.nix @@ -5,7 +5,6 @@ commentStyle = { italic = true; }; - dimInactive = true; terminalColors = true; theme = "wave"; transparent = true; From 0121b7a6368520f5fa8e06388bd9bbe27daeddc6 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 6 Jun 2024 18:53:22 +0100 Subject: [PATCH 3/6] added nur as overlay & refactored firefox --- flake.lock | 76 +++++++----- flake.nix | 3 + .../optional/desktop/common/default.nix | 6 +- .../optional/desktop/common/firefox.nix | 114 +++++++----------- hosts/common/core/default.nix | 33 ++--- 5 files changed, 115 insertions(+), 117 deletions(-) diff --git a/flake.lock b/flake.lock index b32a886..848c7a8 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ ] }, "locked": { - "lastModified": 1713532798, - "narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=", + "lastModified": 1717408969, + "narHash": "sha256-Q0OEFqe35fZbbRPPRdrjTUUChKVhhWXz3T9ZSKmaoVY=", "owner": "numtide", "repo": "devshell", - "rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40", + "rev": "1ebbe68d57457c8cae98145410b164b5477761f4", "type": "github" }, "original": { @@ -45,11 +45,11 @@ ] }, "locked": { - "lastModified": 1717574802, - "narHash": "sha256-TprJdvfwdjj3co7CGZ4jPIlAdZPFwYrQjamvt2B2L4g=", + "lastModified": 1717637172, + "narHash": "sha256-geTO9YL1V9zYGxupuZvKFWxh6II9sH2bjI1dmEVhVYQ=", "owner": "nix-community", "repo": "disko", - "rev": "7fc7009c892509b9bf81cb73c6575f3f9e6321f5", + "rev": "713aa3df481782719aed4d8c20ad31a9effe3564", "type": "github" }, "original": { @@ -96,11 +96,11 @@ ] }, "locked": { - "lastModified": 1715865404, - "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", "type": "github" }, "original": { @@ -177,11 +177,11 @@ ] }, "locked": { - "lastModified": 1716213921, - "narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=", + "lastModified": 1717664902, + "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0", + "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", "type": "github" }, "original": { @@ -240,11 +240,11 @@ ] }, "locked": { - "lastModified": 1717052710, - "narHash": "sha256-LRhOxzXmOza5SymhOgnEzA8EAQp+94kkeUYWKKpLJ/U=", + "lastModified": 1717525419, + "narHash": "sha256-5z2422pzWnPXHgq2ms8lcCfttM0dz+hg+x1pCcNkAws=", "owner": "nix-community", "repo": "home-manager", - "rev": "29c69d9a466e41d46fd3a7a9d0591ef9c113c2ae", + "rev": "a7117efb3725e6197dd95424136f79147aa35e5b", "type": "github" }, "original": { @@ -391,11 +391,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1717196966, - "narHash": "sha256-yZKhxVIKd2lsbOqYd5iDoUIwsRZFqE87smE2Vzf6Ck0=", + "lastModified": 1717602782, + "narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "57610d2f8f0937f39dbd72251e9614b1561942d8", + "rev": "e8057b67ebf307f01bdcc8fba94d94f75039d1f6", "type": "github" }, "original": { @@ -407,11 +407,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1717503908, - "narHash": "sha256-hsxbTeO6Dhobc2kELDwCgRJT9J5TotL6fS8z5P+OskI=", + "lastModified": 1717653235, + "narHash": "sha256-wODpVx0FtLHnyKIOnm4V7fE9P8Pg12u/8ytY++VYMK0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "50a127f8fccd0d24712c8ab146ca251f27cc4cb0", + "rev": "844ccd07fb2aa17250952aee34a6fefd914b4638", "type": "github" }, "original": { @@ -435,11 +435,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1717574948, - "narHash": "sha256-8C2S1WWC4ty1LePzFWp+D6re/pggCJj9tWslddJ/wUw=", + "lastModified": 1717681257, + "narHash": "sha256-0PhFvfc4wDjba1cus2ALsfn0wVizeKkcuF+aqvDJivg=", "owner": "nix-community", "repo": "nixvim", - "rev": "a54ee8ad64c91b587c3460126bad25a441c1118c", + "rev": "36f2e51b28ee3389a67ed5e9ed5c4bd388b06918", "type": "github" }, "original": { @@ -448,6 +448,21 @@ "type": "github" } }, + "nur": { + "locked": { + "lastModified": 1717691888, + "narHash": "sha256-YbIJbbPrKWhjM+ZvPelG/iDfSU3/qwPOI3vAIi+lFYI=", + "owner": "nix-community", + "repo": "NUR", + "rev": "4266b44cd241e3d2baf38bdbe8ce1254defcee6f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, "poetry2nix": { "inputs": { "flake-utils": "flake-utils_3", @@ -460,11 +475,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1717250109, - "narHash": "sha256-MTivB5fsfaPtWwcibBhs20hHYEUe9o9bTRXsGJjQRso=", + "lastModified": 1717602370, + "narHash": "sha256-qS/7is9JbnnycR6QmndsuTQfifWzjhgxObnXw+iHdP8=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "11e97e742da5b4e43c27cfe13fca904e82fd4e56", + "rev": "81662ae1ad31491eae3bb1d976fb74c71853bc63", "type": "github" }, "original": { @@ -483,6 +498,7 @@ "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "nixvim": "nixvim", + "nur": "nur", "sops-nix": "sops-nix", "sqlfmt": "sqlfmt" } @@ -597,11 +613,11 @@ ] }, "locked": { - "lastModified": 1715940852, - "narHash": "sha256-wJqHMg/K6X3JGAE9YLM0LsuKrKb4XiBeVaoeMNlReZg=", + "lastModified": 1717278143, + "narHash": "sha256-u10aDdYrpiGOLoxzY/mJ9llST9yO8Q7K/UlROoNxzDw=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "2fba33a182602b9d49f0b2440513e5ee091d838b", + "rev": "3eb96ca1ae9edf792a8e0963cc92fddfa5a87706", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index e528699..e5bfa0c 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,9 @@ # Nixpkgs nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + # NUR + nur.url = "github:nix-community/NUR"; + # Import personal packages repo sqlfmt.url = "git+https://git.bitlab21.com/sam/flake-packages?dir=sqlfmt"; diff --git a/home/common/optional/desktop/common/default.nix b/home/common/optional/desktop/common/default.nix index 15bf3dc..d507708 100644 --- a/home/common/optional/desktop/common/default.nix +++ b/home/common/optional/desktop/common/default.nix @@ -1,9 +1,13 @@ -{ pkgs, ... }: { +{ pkgs, inputs, ... }: { imports = [ ./firefox.nix ./alacritty.nix ]; + nixpkgs.overlays = [ + inputs.nur.overlay + ]; + # Global packages for desktop environments home.packages = [ pkgs.alacritty diff --git a/home/common/optional/desktop/common/firefox.nix b/home/common/optional/desktop/common/firefox.nix index 5d58021..df8a275 100644 --- a/home/common/optional/desktop/common/firefox.nix +++ b/home/common/optional/desktop/common/firefox.nix @@ -1,82 +1,43 @@ -{ pkgs, inputs, config, ... }: +{ pkgs, config, ... }: let user = config.home.username; in { programs.firefox = { enable = true; - policies = { - DisableTelemetry = true; - DisableFirefoxStudies = true; - EnableTrackingProtection = { - Value= true; - Locked = true; - Cryptomining = true; - Fingerprinting = true; - }; - DisablePocket = true; - DisableFirefoxAccounts = true; - DisableAccounts = true; - DisableFirefoxScreenshots = true; - OverrideFirstRunPage = ""; - OverridePostUpdatePage = ""; - DontCheckDefaultBrowser = true; - DisplayBookmarksToolbar = "never"; # alternatives: "always" or "newtab" - DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" - SearchBar = "unified"; # alternative: "separate" - SearchEngines = { - Default = "DuckDuckGo"; - PreventInstalls = true; - }; - /* ---- EXTENSIONS ---- */ - # Check about:support for extension/add-on ID strings. - # Valid strings for installation_mode are "allowed", "blocked", - # "force_installed" and "normal_installed". - ExtensionSettings = { - "*".installation_mode = "blocked"; # blocks all addons except the ones specified below - # uBlock Origin: - "uBlock0@raymondhill.net" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; - installation_mode = "force_installed"; - }; - # Privacy Badger: - "jid1-MnnxcxisBPnSXQ@jetpack" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi"; - installation_mode = "force_installed"; - }; - # Bitwarden - "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi"; - installation_mode = "force_installed"; - }; - # Dark Reader - "addon@darkreader.org" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/darkreader/latest.xpi"; - installation_mode = "force_installed"; - }; - # Sponser Block - "sponsorBlocker@ajay.app" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/sponsorblock/latest.xpi"; - installation_mode = "force_installed"; - }; - # Return Youtube Dislike - "{762f9885-5a13-4abd-9c77-433dcd38b8fd}" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/return-youtube-dislikes/latest.xpi"; - installation_mode = "force_installed"; - }; - }; - }; profiles.${user} = { - - search.engines = { - "Searxng" = { - urls = [{ - template = "http://10.0.10.35:8855"; - }]; - + search = { + force = true; + default = "Searx"; + order = [ "Searx" "DuckDuckGo" ]; + engines = { + "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" ]; + }; + "Searx" = { + urls = [{ template = "http://10.0.10.35:8855/?q={searchTerms}"; }]; + iconUpdateURL = "https://docs.searxng.org/_static/searxng-wordmark.svg"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ "@searx" ]; + }; + "Bing".metaData.hidden = true; + "Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias }; }; - search.force = true; bookmarks = [ { @@ -99,8 +60,21 @@ in "identity.fxaccounts.enabled" = false; "signon.rememberSignons" = false; "browser.compactmode.show" = true; + "browser.startup.homepage" = "http://10.0.10.35:8855"; + "browser.search.defaultenginename" = "Searx"; + "browser.search.order.1" = "Searx"; }; + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + return-youtube-dislikes + bitwarden + sponsorblock + darkreader + vimium + privacy-badger + ]; + }; }; } diff --git a/hosts/common/core/default.nix b/hosts/common/core/default.nix index 7b62e43..1cfd3a6 100644 --- a/hosts/common/core/default.nix +++ b/hosts/common/core/default.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, inputs, config, outputs, ...}: +{ pkgs, lib, inputs, config, outputs, ... }: let sopsHashedPasswordFile = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."passwords/root".path; in @@ -9,15 +9,16 @@ in ]; nixpkgs = { - overlays = [ - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - ]; - config = { - allowUnfree = true; - }; + overlays = [ + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + inputs.nur.overlay + ]; + config = { + allowUnfree = true; }; + }; programs.gnupg.agent = { enable = true; @@ -32,16 +33,16 @@ in root = { hashedPasswordFile = sopsHashedPasswordFile; }; - }; + }; }; environment.systemPackages = [ - pkgs.rsync - pkgs.curl - pkgs.just - pkgs.git - pkgs.vim - ]; + pkgs.rsync + pkgs.curl + pkgs.just + pkgs.git + pkgs.vim + ]; system.stateVersion = "23.11"; } From 93c8f1593dd50f94343bd59e637d8fecbf1a64c3 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 6 Jun 2024 19:55:17 +0100 Subject: [PATCH 4/6] added zotero and persisted .zotero for media user --- home/common/optional/desktop/common/firefox.nix | 1 + hosts/common/users/media/default.nix | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/home/common/optional/desktop/common/firefox.nix b/home/common/optional/desktop/common/firefox.nix index df8a275..7de4cc1 100644 --- a/home/common/optional/desktop/common/firefox.nix +++ b/home/common/optional/desktop/common/firefox.nix @@ -73,6 +73,7 @@ in darkreader vimium privacy-badger + zotero-connector ]; }; diff --git a/hosts/common/users/media/default.nix b/hosts/common/users/media/default.nix index 3a8f470..f88b6ce 100644 --- a/hosts/common/users/media/default.nix +++ b/hosts/common/users/media/default.nix @@ -33,14 +33,12 @@ in "Sync" "Keep" ".ssh" - ".config/dconf" - ".config/cinnamon" - ".config/nemo" + ".config" ".mozilla" ".local" + ".zotero" ]; files = [ - ".config/cinnamon-monitors.xml" ]; }; }; From eda162a7ff357ac93653eab3dd8f154dea427805 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 8 Jun 2024 17:04:37 +0100 Subject: [PATCH 5/6] zotero prefs --- flake.lock | 20 +++++------ .../optional/desktop/common/default.nix | 1 + .../common/optional/desktop/common/zotero.nix | 33 +++++++++++++++++++ hosts/common/users/sam/default.nix | 10 +++--- 4 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 home/common/optional/desktop/common/zotero.nix diff --git a/flake.lock b/flake.lock index 848c7a8..b633cf0 100644 --- a/flake.lock +++ b/flake.lock @@ -333,11 +333,11 @@ "nix-secrets": { "flake": false, "locked": { - "lastModified": 1717581732, - "narHash": "sha256-mBkVq89pmsOGRIBVANJYILV81YXHBmK3xHbhqxvoR8s=", + "lastModified": 1717760051, + "narHash": "sha256-4yXaR3PIOJGQwTxA3eVDEu1iBlsmuvXWv3Ed0NrJgtU=", "ref": "refs/heads/master", - "rev": "0d2708ad195b6ec5e8ede2a6bc3876c855710d26", - "revCount": 86, + "rev": "521163d7278e71f084497910fa756bedcbfe97eb", + "revCount": 88, "type": "git", "url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git" }, @@ -407,11 +407,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1717653235, - "narHash": "sha256-wODpVx0FtLHnyKIOnm4V7fE9P8Pg12u/8ytY++VYMK0=", + "lastModified": 1717737457, + "narHash": "sha256-hqHp0W7ibfdu5DFc6EG3S3c+GSAbti7VUldFXSf/WiI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "844ccd07fb2aa17250952aee34a6fefd914b4638", + "rev": "bf3faad723ca984fc4ea95c1cee1d975a8ca2a28", "type": "github" }, "original": { @@ -450,11 +450,11 @@ }, "nur": { "locked": { - "lastModified": 1717691888, - "narHash": "sha256-YbIJbbPrKWhjM+ZvPelG/iDfSU3/qwPOI3vAIi+lFYI=", + "lastModified": 1717749895, + "narHash": "sha256-E6fEND68P37NMIhPyvgZl0jD7KlSg2QKZ1zpsXpobfQ=", "owner": "nix-community", "repo": "NUR", - "rev": "4266b44cd241e3d2baf38bdbe8ce1254defcee6f", + "rev": "b93b6c0b706d78ad95d52104728fd6eed3460f80", "type": "github" }, "original": { diff --git a/home/common/optional/desktop/common/default.nix b/home/common/optional/desktop/common/default.nix index d507708..10be23e 100644 --- a/home/common/optional/desktop/common/default.nix +++ b/home/common/optional/desktop/common/default.nix @@ -2,6 +2,7 @@ imports = [ ./firefox.nix ./alacritty.nix + ./zotero.nix ]; nixpkgs.overlays = [ diff --git a/home/common/optional/desktop/common/zotero.nix b/home/common/optional/desktop/common/zotero.nix new file mode 100644 index 0000000..f6b21c6 --- /dev/null +++ b/home/common/optional/desktop/common/zotero.nix @@ -0,0 +1,33 @@ +{ pkgs, config, ... }: +let + user = config.home.username; +in +{ + home.packages = [ + pkgs.zotero + ]; + + home.file.".zotero/zotero/profiles.ini".text = '' + [General] + StartWithLastProfile=1 + + [Profile0] + Name=default + IsRelative=1 + Path=zprofile.default + Default=1 + ''; + + home.file.".zotero/zotero/zprofile.default/user.js".text = '' + user_pref("extensions.zotero.dataDir", "/home/${user}/.local/share/Zotero"); + user_pref("extensions.zotero.firstRun.skipFirefoxProfileAccessCheck", true); + user_pref("extensions.zotero.firstRun2", false); + user_pref("extensions.zotero.useDataDir", true); + user_pref("intl.accept_languages", "en-GB, en"); + user_pref("extensions.zotero.sync.server.username", "samual.shop@proton.me"); + user_pref("extensions.zotero.sync.fulltext.enabled", false); + user_pref("extensions.zotero.sync.storage.enabled", false); + user_pref("extensions.zotero.sync.storage.groups.enabled", false); + ''; + +} diff --git a/hosts/common/users/sam/default.nix b/hosts/common/users/sam/default.nix index 4ee6230..8c5c1f2 100644 --- a/hosts/common/users/sam/default.nix +++ b/hosts/common/users/sam/default.nix @@ -36,6 +36,9 @@ in owner = "${username}"; }; "passwords/postgres" = { }; + "software/zotero/username" = { }; + "software/zotero/password" = { }; + "software/zotero/guid" = { }; }; # Setup postgres connections for db_ui @@ -56,10 +59,10 @@ in ''; }; - # The containing ssh folders are created as root and if this is the first ~/.ssh/ entry when writing keys, - # the ownership is busted and home-manager can't target because it can't write into .ssh... + # The containing folders are created as root and if this is the first entry when writing keys, + # the ownership is busted and home-manager can't target because it can't write to these dirs... # FIXME: We might not need this depending on how https://github.com/Mic92/sops-nix/issues/381 is fixed - system.activationScripts.sopsSetSshOwnwership = + system.activationScripts.sopsSetOwnwership = let sshFolder = "/home/${username}/.ssh"; user = config.users.users.${username}.name; @@ -76,7 +79,6 @@ in ]; }; - programs.zsh.enable = true; home-manager = { From abefe5250452bf1350ae1b563e21c9d8dc56a1f4 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 10 Jun 2024 14:05:06 +0100 Subject: [PATCH 6/6] steam --- flake.lock | 44 ++++++++++++------------- hosts/common/users/media/default.nix | 2 ++ hosts/sparky/default.nix | 48 ++++++++++++++++++++++++++-- 3 files changed, 70 insertions(+), 24 deletions(-) diff --git a/flake.lock b/flake.lock index b633cf0..d424eaa 100644 --- a/flake.lock +++ b/flake.lock @@ -45,11 +45,11 @@ ] }, "locked": { - "lastModified": 1717637172, - "narHash": "sha256-geTO9YL1V9zYGxupuZvKFWxh6II9sH2bjI1dmEVhVYQ=", + "lastModified": 1717770040, + "narHash": "sha256-eq9gP060TqWqRf2k4WO5FrG49rVq5Jy3Ptusg0CFdds=", "owner": "nix-community", "repo": "disko", - "rev": "713aa3df481782719aed4d8c20ad31a9effe3564", + "rev": "398acc470f7c2d68621db01900f053e6000129c4", "type": "github" }, "original": { @@ -333,11 +333,11 @@ "nix-secrets": { "flake": false, "locked": { - "lastModified": 1717760051, - "narHash": "sha256-4yXaR3PIOJGQwTxA3eVDEu1iBlsmuvXWv3Ed0NrJgtU=", + "lastModified": 1717864759, + "narHash": "sha256-DUtmDvpNyOZG+UDONTBfRiAdCaI7E1ngVhmUOAjj3wg=", "ref": "refs/heads/master", - "rev": "521163d7278e71f084497910fa756bedcbfe97eb", - "revCount": 88, + "rev": "81aff439158dc6bb21251dc3be672db671e4a519", + "revCount": 89, "type": "git", "url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git" }, @@ -407,11 +407,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1717737457, - "narHash": "sha256-hqHp0W7ibfdu5DFc6EG3S3c+GSAbti7VUldFXSf/WiI=", + "lastModified": 1717839683, + "narHash": "sha256-kC0eyEsfpXbtQ2Ee5kgjmLFSVsLgnqpj10LjEi+fK+g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bf3faad723ca984fc4ea95c1cee1d975a8ca2a28", + "rev": "3f3a01219b4a1b6ee63039a3aa63948fbf37c0dd", "type": "github" }, "original": { @@ -435,11 +435,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1717681257, - "narHash": "sha256-0PhFvfc4wDjba1cus2ALsfn0wVizeKkcuF+aqvDJivg=", + "lastModified": 1717861394, + "narHash": "sha256-U7E1Wg5PRKUYqfeL8H6KU/5VjFo8bkxbFzigN2grkQI=", "owner": "nix-community", "repo": "nixvim", - "rev": "36f2e51b28ee3389a67ed5e9ed5c4bd388b06918", + "rev": "db32ebe205111af0b74d74684df64674ffcf3b36", "type": "github" }, "original": { @@ -450,11 +450,11 @@ }, "nur": { "locked": { - "lastModified": 1717749895, - "narHash": "sha256-E6fEND68P37NMIhPyvgZl0jD7KlSg2QKZ1zpsXpobfQ=", + "lastModified": 1717872410, + "narHash": "sha256-kL4bugfx+R4ozR6t8MrGSdv3LVX7H9IkCxmvjaLAQ7o=", "owner": "nix-community", "repo": "NUR", - "rev": "b93b6c0b706d78ad95d52104728fd6eed3460f80", + "rev": "3b134079df522044c0da57f1b7785646a7b76518", "type": "github" }, "original": { @@ -475,11 +475,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1717602370, - "narHash": "sha256-qS/7is9JbnnycR6QmndsuTQfifWzjhgxObnXw+iHdP8=", + "lastModified": 1717774136, + "narHash": "sha256-comOhXDFUrbVba47gPenVBKy2foM3m3qOqpcP8umWDA=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "81662ae1ad31491eae3bb1d976fb74c71853bc63", + "rev": "370da3b6fefc6c11367463b68d010f9950aaa80c", "type": "github" }, "original": { @@ -635,11 +635,11 @@ ] }, "locked": { - "lastModified": 1717182148, - "narHash": "sha256-Hi09/RoizxubRf3PHToT2Nm7TL8B/abSVa6q82uEgNI=", + "lastModified": 1717278143, + "narHash": "sha256-u10aDdYrpiGOLoxzY/mJ9llST9yO8Q7K/UlROoNxzDw=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "03b982b77df58d5974c61c6022085bafe780c1cf", + "rev": "3eb96ca1ae9edf792a8e0963cc92fddfa5a87706", "type": "github" }, "original": { diff --git a/hosts/common/users/media/default.nix b/hosts/common/users/media/default.nix index f88b6ce..ec8af1d 100644 --- a/hosts/common/users/media/default.nix +++ b/hosts/common/users/media/default.nix @@ -37,6 +37,8 @@ in ".mozilla" ".local" ".zotero" + ".var" + ".steam" ]; files = [ ]; diff --git a/hosts/sparky/default.nix b/hosts/sparky/default.nix index bc5b60a..47ff70e 100644 --- a/hosts/sparky/default.nix +++ b/hosts/sparky/default.nix @@ -1,4 +1,4 @@ -{ inputs, config, lib, pkgs, outputs,... }: +{ inputs, config, lib, pkgs, outputs, ... }: let # Disko setup fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence @@ -45,14 +45,58 @@ in enableIPv6 = false; }; + # Gaming + hardware.xone.enable = true; + environment.systemPackages = with pkgs; [ + #Xbox controller + linuxKernel.packages.linux_zen.xone + + # Steam + mangohud + gamemode + + # WINE + wine + winetricks + protontricks + vulkan-tools + + # Extra dependencies + # https://github.com/lutris/docs/ + gnutls + openldap + libgpgerror + freetype + sqlite + libxml2 + xml2 + SDL2 + ]; + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ # Add additional package names here "nvidia-x11" "nvidia-settings" "nvidia-persistenced" + "steam" + "steam-original" + "steam-run" ]; + programs.steam.enable = true; + programs.gamemode.enable = true; + nixpkgs.config.packageOverrides = pkgs: { + steam = pkgs.steam.override { + extraPkgs = pkgs: with pkgs; [ + pango + libthai + harfbuzz + gamemode + ]; + }; + }; + services.displayManager.defaultSession = "cinnamon"; services.libinput.enable = true; @@ -65,7 +109,7 @@ in ''; desktopManager = { cinnamon.enable = true; - }; + }; }; # Enable OpenGL