diff --git a/configuration.nix b/configuration.nix index 9912fbf..460f1e4 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,10 +2,11 @@ # your system. Help is available in the configuration.nix(5) man page, on # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ config -, lib -, pkgs -, ... +{ + config, + lib, + pkgs, + ... }: { @@ -80,8 +81,6 @@ ]; }; - programs.firefox.enable = true; - # List packages installed in system profile. # You can use https://search.nixos.org/ to find more packages (and options). environment.systemPackages = with pkgs; [ diff --git a/flake.lock b/flake.lock index 72ab592..bf4b64a 100644 --- a/flake.lock +++ b/flake.lock @@ -167,6 +167,28 @@ "url": "https://install.determinate.systems/determinate-nixd/tag/v3.11.1/x86_64-linux" } }, + "firefox-addons": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "dir": "pkgs/firefox-addons", + "lastModified": 1757410664, + "narHash": "sha256-MVjY6naARVAOIcNCDPUeNqqw1ttIuaDxBhE5c+i21nI=", + "owner": "rycee", + "repo": "nur-expressions", + "rev": "59d32d171d43bbe5ba9f3cb4723066f91595786f", + "type": "gitlab" + }, + "original": { + "dir": "pkgs/firefox-addons", + "owner": "rycee", + "repo": "nur-expressions", + "type": "gitlab" + } + }, "firefox-gnome-theme": { "flake": false, "locked": { @@ -348,11 +370,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1757423134, - "narHash": "sha256-CZpxYEwjxLDdF1xGtrPJU2DX8k7Q5ajDBjBrjlEswik=", + "lastModified": 1757437545, + "narHash": "sha256-7ssbrFnmSrqtCtOySiu5ncyOBxPrR6p2nhNHrg6D+fo=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "11d325391d1bbb4bb8f49010959f54bb1f6038b4", + "rev": "ef694b996daeeb8684c0adfaa9b7067a6e709054", "type": "github" }, "original": { @@ -523,11 +545,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1757341549, - "narHash": "sha256-fRnT+bwP1sB6ne7BLw4aXkVYjr+QCZZ+e4MhbokHyd4=", + "lastModified": 1757408970, + "narHash": "sha256-aSgK4BLNFFGvDTNKPeB28lVXYqVn8RdyXDNAvgGq+k0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9d1fa9fa266631335618373f8faad570df6f9ede", + "rev": "d179d77c139e0a3f5c416477f7747e9d6b7ec315", "type": "github" }, "original": { @@ -647,6 +669,7 @@ "c3d2-user-module": "c3d2-user-module", "comin": "comin", "determinate": "determinate", + "firefox-addons": "firefox-addons", "home-manager": "home-manager", "niri": "niri", "nix-index-db": "nix-index-db", diff --git a/flake.nix b/flake.nix index 486c9ef..59ac47e 100644 --- a/flake.nix +++ b/flake.nix @@ -51,6 +51,7 @@ quickshell, stylix, comin, + firefox-addons, }: let system = "x86_64-linux"; diff --git a/modules/alacritty.nix b/modules/alacritty.nix index 5004083..6b127fe 100644 --- a/modules/alacritty.nix +++ b/modules/alacritty.nix @@ -2,36 +2,34 @@ { programs.alacritty.enable = true; programs.alacritty.settings = { - window.opacity = lib.mkDefault 0.8; - /* - colors.bright = { - black = "#444b6a"; - blue = "#7da6ff"; - cyan = "#0db9d7"; - green = "#b9f27c"; - magenta = "#bb9af7"; - red = "#ff7a93"; - white = "#acb0d0"; - yellow = "#ff9e64"; - }; - colors.normal = { - black = "#32344a"; - blue = "#7aa2f7"; - cyan = "#449dab"; - green = "#9ece6a"; - magenta = "#ad8ee6"; - red = "#f7768e"; - white = "#787c99"; - yellow = "#e0af68"; - }; - colors.primary = { - background = "#1a1b26"; - foreground = "#a9b1d6"; - }; - */ - font = { + window.opacity = lib.mkForce 0.8; + colors.bright = lib.mkForce { + black = "#444b6a"; + blue = "#7da6ff"; + cyan = "#0db9d7"; + green = "#b9f27c"; + magenta = "#bb9af7"; + red = "#ff7a93"; + white = "#acb0d0"; + yellow = "#ff9e64"; + }; + colors.normal = lib.mkForce { + black = "#32344a"; + blue = "#7aa2f7"; + cyan = "#449dab"; + green = "#9ece6a"; + magenta = "#ad8ee6"; + red = "#f7768e"; + white = "#787c99"; + yellow = "#e0af68"; + }; + colors.primary = lib.mkForce { + background = "#1a1b26"; + foreground = "#a9b1d6"; + }; + font = lib.mkForce { normal = { - family = lib.mkForce "Iosevka"; + family = "Iosevka"; style = "Regular"; }; bold = { diff --git a/modules/firefox.nix b/modules/firefox.nix new file mode 100644 index 0000000..54a0a46 --- /dev/null +++ b/modules/firefox.nix @@ -0,0 +1,119 @@ +{ config, pkgs, ... }: + +{ + programs.firefox = { + enable = true; + + policies = { + AutofillAddressEnabled = false; + AutofillCreditCardEnabled = false; + BlockAboutAddons = true; + BlockAboutConfig = true; + BlockAboutProfiles = true; + Bookmarks = [ + { + Placement = "toolbar"; + Title = "NixOS Search"; + URL = "https://search.nixos.org"; + } + { + Placement = "toolbar"; + Title = "NixOS Wiki"; + URL = "https://wiki.nixos.org"; + } + { + Placement = "toolbar"; + Title = "c-base"; + URL = "https://c-base.org"; + } + { + Placement = "toolbar"; + Title = "c-base Wiki"; + URL = "https://wiki.c-base.org"; + } + ]; + Cookies = { + Behavior = "accept"; + BehaviorPrivateBrowsing = "reject"; + }; + DisableAccounts = true; + DisableAppUpdate = true; + DisableBuiltinPDFViewer = true; + DisableFeedbackCommands = true; + DisableFirefoxScreenshots = true; + DisableFirefoxStudies = true; + DisableForgetButton = true; + DisableFormHistory = true; + DisablePasswordReveal = true; + DisableProfileImport = true; + DisableProfileRefresh = true; + DisableSetDesktopBackground = true; + DisableTelemetry = true; + EnableTrackingProtection = { + BaselineExceptions = true; + Category = "standard"; + ConvenienceExceptions = true; + Cryptomining = true; + EmailTracking = true; + Fingerprinting = true; + SuspectedFingerprinting = true; + Value = true; + }; + ExtensionUpdate = false; + FirefoxSuggest = { + ImproveSuggest = false; + SponsoredSuggestions = false; + WebSuggestions = true; + }; + HardwareAcceleration = false; + NewTabPage = true; + PasswordManagerEnabled = false; + PictureInPicture = { + Enabled = true; + }; + Preferences = { + browser.fixup.dns_first_for_single_words = { + Status = "locked"; + Type = "boolean"; + Value = true; + }; + browser.search.update = { + Status = "locked"; + Type = "boolean"; + Value = true; + }; + extensions.getAddons.showPane = { + Status = "locked"; + Type = "boolean"; + Value = false; + }; + media.gmp-gmpopenh264.enabled = { + Status = "locked"; + Type = "boolean"; + Value = true; + }; + network.IDN_show_punycode = { + Status = "locked"; + Type = "boolean"; + Value = true; + }; + network.dns.disableIPv6 = { + Status = "locked"; + Type = "boolean"; + Value = false; + }; + }; + PrintingEnabled = true; + PrivateBrowsingModeAvailability = 0; + SanitizeOnShutdown = { + Cache = true; + Cookies = false; + FormData = false; + History = false; + Sessions = false; + SiteSettings = false; + }; + TranslateEnabled = false; + }; + }; +} diff --git a/modules/home.nix b/modules/home.nix index abe342d..7958b43 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -15,6 +15,9 @@ ./hypridle.nix ./fuzzel.nix ./hyfetch.nix + ./ssh.nix + ./firefox.nix + ./wallpaper.nix ]; # TODO please change the username & home directory to your own diff --git a/modules/nix.nix b/modules/nix.nix index 05abfad..217c17a 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -1,8 +1,18 @@ -{ ... }: { +{ ... }: +{ nix.settings = { - experimental-features = [ "nix-command" "flakes" ]; + experimental-features = [ + "nix-command" + "flakes" + ]; - substituters = [ "https://nix-gaming.cachix.org" ]; - trusted-public-keys = [ "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" ]; + substituters = [ + "https://nix-gaming.cachix.org" + "https://attic.mildlyfunctional.gay/nixbsd" + ]; + trusted-public-keys = [ + "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" + "nixbsd:gwcQlsUONBLrrGCOdEboIAeFq9eLaDqfhfXmHZs1mgc=" + ]; }; } diff --git a/modules/nushell.nix b/modules/nushell.nix index 9385c31..b7ad3dc 100644 --- a/modules/nushell.nix +++ b/modules/nushell.nix @@ -1,10 +1,15 @@ -{ lib, pkgs, ... }: { +{ lib, pkgs, ... }: +let + hx = lib.getExe pkgs.helix; + nix = lib.getExe pkgs.nix; +in +{ programs = { nushell = { enable = true; # The config.nu can be anywhere you want if you like to edit your Nushell with Nu #configFile.source = ./.../config.nu; - # for editing directly to config.nu + # for editing directly to config.nu extraConfig = '' # Common ls aliases and sort them by type and then name # Inspired by https://github.com/nushell/nushell/issues/7190 @@ -31,9 +36,7 @@ # fish completions https://www.nushell.sh/cookbook/external_completers.html#fish-completer let fish_completer = {|spans| - ${ - lib.getExe pkgs.fish - } --command $'complete "--do-complete=($spans | str join " ")"' + ${lib.getExe pkgs.fish} --command $'complete "--do-complete=($spans | str join " ")"' | $"value(char tab)description(char newline)" + $in | from tsv --flexible --no-infer } @@ -92,22 +95,24 @@ shellAliases = { fg = "job unfreeze"; - nano = "hx"; - vi = "hx"; - nvim = "hx"; - vim = "hx"; - devenv-init = "nix flake init --template github:cachix/devenv"; - devenv-enter = "nix develop --impure"; - rust-init = "nix flake init --template templates#rust"; - c-init = "nix flake init --template templates#c-hello"; - go-hello = "nix flake init --template templates#go-hello"; - haskell-hello = "nix flake init --template templates#haskell-hello"; - neofetch = "hyfetch"; + nano = hx; + vi = hx; + nvim = hx; + vim = hx; + devenv-init = "${nix} flake init --template github:cachix/devenv"; + devenv-enter = "${nix} develop --impure"; + rust-init = "${nix} flake init --template templates#rust"; + c-init = "${nix} flake init --template templates#c-hello"; + go-hello = "${nix} flake init --template templates#go-hello"; + haskell-hello = "${nix} flake init --template templates#haskell-hello"; + g = "${lib.getExe pkgs.git}"; }; }; carapace.enable = true; carapace.enableNushellIntegration = true; - starship = { enable = true; }; + starship = { + enable = true; + }; }; } diff --git a/modules/ssh.nix b/modules/ssh.nix new file mode 100644 index 0000000..546f6b5 --- /dev/null +++ b/modules/ssh.nix @@ -0,0 +1,39 @@ +{ + config, + pkgs, + lib, + ... +}: + +let + mkMatchBlock = + { hostname }: + { + inherit hostname; + user = "lucy"; # Use dynamically retrieved user + identityFile = [ + "/nix/persist/etc/ssh/ssh_host_ed25519_key" + ]; + port = 22; + }; +in + +{ + # Enable SSH client in Home Manager + programs.ssh = { + enable = true; + + # Define host-specific SSH configurations (match blocks) + matchBlocks = { + "shell.c-base.org" = mkMatchBlock { hostname = "shell.c-base.org"; }; + "code.c-base.org" = mkMatchBlock { hostname = "code.c-base.org"; }; + }; + + # Any extra SSH configuration options you want globally + extraConfig = '' + # Example of global settings + Compression yes + ServerAliveInterval 60 + ''; + }; +} diff --git a/modules/wallpaper.nix b/modules/wallpaper.nix new file mode 100644 index 0000000..0c42afe --- /dev/null +++ b/modules/wallpaper.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + services.wpaperd = { + enable = true; + settings = { + eDP-1 = { + path = ../assets/wp6553608.jpg; + }; + }; + }; +} diff --git a/persist.nix b/persist.nix index b242fd4..b15692f 100644 --- a/persist.nix +++ b/persist.nix @@ -1,10 +1,10 @@ -{ ... }: { +{ ... }: +{ # machine-id is used by systemd for the journal, if you don't # persist this file you won't be able to easily use journalctl to # look at journals for previous boots. environment.etc."machine-id".source = "/nix/persist/etc/machine-id"; - # if you want to run an openssh daemon, you may want to store the # host keys across reboots. # @@ -13,6 +13,7 @@ environment.etc."ssh/ssh_host_rsa_key".source = "/nix/persist/etc/ssh/ssh_host_rsa_key"; environment.etc."ssh/ssh_host_rsa_key.pub".source = "/nix/persist/etc/ssh/ssh_host_rsa_key.pub"; environment.etc."ssh/ssh_host_ed25519_key".source = "/nix/persist/etc/ssh/ssh_host_ed25519_key"; - environment.etc."ssh/ssh_host_ed25519_key.pub".source = "/nix/persist/etc/ssh/ssh_host_ed25519_key.pub"; + environment.etc."ssh/ssh_host_ed25519_key.pub".source = + "/nix/persist/etc/ssh/ssh_host_ed25519_key.pub"; }