diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 5502d22..f5b0051 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -10,10 +10,10 @@ ./system/system.nix inputs.home-manager.nixosModules.home-manager ]; - + nix.settings.experimental-features = ["nix-command" "flakes"]; - # Bootloader. + # Bootloader. boot.loader.systemd-boot.enable = true; home-manager = { @@ -29,6 +29,8 @@ NIXOS_OZONE_WL = "1"; EDITOR = "nvim"; FLAKE = "/home/foglar/dotfiles"; + + DEFAULT_BROWSER = "${pkgs.librewolf}/bin/librewolf"; }; users.users.foglar = { @@ -40,6 +42,17 @@ ]; }; + xdg.mime.enable = true; + xdg.mime.defaultApplications = { + "text/html" = "librewolf.desktop"; + "x-scheme-handler/http" = "librewolf.desktop"; + "x-scheme-handler/https" = "librewolf.desktop"; + "x-scheme-handler/about" = "librewolf.desktop"; + "x-scheme-handler/unknown" = "librewolf.desktop"; + "text/plain" = "nvim.desktop"; + "application/pdf" = "evince"; + }; + # Allow unfree packages nixpkgs.config.allowUnfree = true; diff --git a/nixos/home.nix b/nixos/home.nix index 953cfb4..976ce8e 100644 --- a/nixos/home.nix +++ b/nixos/home.nix @@ -13,7 +13,7 @@ games.enable = true; gtk.enable = true; - + programs.bash = { enable = true; enableCompletion = true; @@ -38,7 +38,6 @@ packages = "paru -Qe | fzf | wl-copy"; cdx = "zoxide query --interactive"; - distrobox-enter = "distrobox-enter --root"; distrobox-create = "distrobox-create --root"; }; @@ -67,16 +66,6 @@ XDG_PICTURES_DIR = "$HOME/Pictures/Screenshots/"; }; - #xdg.mimeApps = { - # enable = true; - # associations.added = { - # "application/pdf" = ["org.gnome.Evince.desktop"]; - # }; - # defaultApplications = { - # "application/pdf" = ["org.gnome.Evince.desktop"]; - # }; - #}; - # Let Home Manager install and manage itself. programs.home-manager.enable = true; } diff --git a/nixos/packages/applications.nix b/nixos/packages/applications.nix index 97b9b79..19efea8 100644 --- a/nixos/packages/applications.nix +++ b/nixos/packages/applications.nix @@ -25,7 +25,6 @@ plasma5Packages.kdeconnect-kde qbittorrent vlc - #tor-browser openrocket spotify spotube diff --git a/nixos/packages/hacking/hacking.nix b/nixos/packages/hacking/hacking.nix index 8250566..c89b85b 100644 --- a/nixos/packages/hacking/hacking.nix +++ b/nixos/packages/hacking/hacking.nix @@ -19,6 +19,7 @@ hashcat tcpdump sqlmap + tor-browser ]; }; } diff --git a/nixos/system/packages.nix b/nixos/system/packages.nix index 17e8e10..f1c3c85 100644 --- a/nixos/system/packages.nix +++ b/nixos/system/packages.nix @@ -1,10 +1,18 @@ -{...}: -{ +{lib, ...}: { imports = [ ./packages/docker.nix - ./packages/programs.nix ./packages/steam.nix ./packages/tor.nix ./packages/virtual-machines.nix ]; -} \ No newline at end of file + + package = { + docker.enable = lib.mkDefault true; + steam.enable = lib.mkDefault true; + proxychains.enable = lib.mkDefault true; + tor.enable = lib.mkDefault true; + virt-manager.enable = lib.mkDefault true; + }; + programs.kdeconnect.enable = true; + programs.wireshark.enable = true; +} diff --git a/nixos/system/packages/docker.nix b/nixos/system/packages/docker.nix index 462d1b6..53635c6 100644 --- a/nixos/system/packages/docker.nix +++ b/nixos/system/packages/docker.nix @@ -1,9 +1,19 @@ -{...}: { - virtualisation.docker = { - enable = true; - rootless = { +{ + lib, + config, + ... +}: { + options = { + package.docker.enable = lib.mkEnableOption "Enable Docker"; + }; + + config = lib.mkIf config.package.docker.enable { + virtualisation.docker = { enable = true; - setSocketVariable = true; + rootless = { + enable = true; + setSocketVariable = true; + }; }; }; } diff --git a/nixos/system/packages/programs.nix b/nixos/system/packages/programs.nix deleted file mode 100644 index 1cd4261..0000000 --- a/nixos/system/packages/programs.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: -{ - programs.kdeconnect.enable = true; - programs.wireshark.enable = true; -} \ No newline at end of file diff --git a/nixos/system/packages/steam.nix b/nixos/system/packages/steam.nix index 8c9c1f5..39aba2f 100644 --- a/nixos/system/packages/steam.nix +++ b/nixos/system/packages/steam.nix @@ -1,9 +1,18 @@ -{...}: { - programs.steam = { - enable = true; - remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play - dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server - localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers + lib, + config, + ... +}: { + options = { + package.steam.enable = lib.mkEnableOption "Enable Steam module"; }; -} \ No newline at end of file + + config = lib.mkIf config.package.steam.enable { + programs.steam = { + enable = true; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers + }; + }; +} diff --git a/nixos/system/packages/tor.nix b/nixos/system/packages/tor.nix index 6eda807..7c2b939 100644 --- a/nixos/system/packages/tor.nix +++ b/nixos/system/packages/tor.nix @@ -1,20 +1,32 @@ -{...}: { - programs.proxychains = { - enable = true; - chain.type = "dynamic"; - proxies = { - tor-proxy = { - enable = true; - type = "socks5"; - host = "127.0.0.1"; - port = 9050; - }; - }; + lib, + config, + ... +}: { + options = { + package.tor.enable = lib.mkEnableOption "Enable Tor"; + package.proxychains.enable = lib.mkEnableOption "Enable Proxychains"; }; - services.tor = { - enable = true; - }; - services.tor.client.enable = true; -} \ No newline at end of file + config = + lib.mkIf config.package.tor.enable { + services.tor = { + enable = true; + }; + services.tor.client.enable = true; + } + // lib.mkIf config.package.proxychains.enable { + programs.proxychains = { + enable = true; + chain.type = "dynamic"; + proxies = { + tor-proxy = { + enable = true; + type = "socks5"; + host = "127.0.0.1"; + port = 9050; + }; + }; + }; + }; +} diff --git a/nixos/system/packages/virtual-machines.nix b/nixos/system/packages/virtual-machines.nix index 57968e8..ff42bd1 100644 --- a/nixos/system/packages/virtual-machines.nix +++ b/nixos/system/packages/virtual-machines.nix @@ -1,5 +1,13 @@ -{...}: { - virtualisation.libvirtd.enable = true; - programs.virt-manager.enable = true; -} \ No newline at end of file + config, + lib, + ... +}: { + options = { + package.virt-manager.enable = lib.mkEnableOption "Enable virt-manager"; + }; + config = lib.mkIf config.package.virt-manager.enable { + virtualisation.libvirtd.enable = true; + programs.virt-manager.enable = true; + }; +}