diff --git a/flake.lock b/flake.lock index df8d4de..4fe5a78 100644 --- a/flake.lock +++ b/flake.lock @@ -191,20 +191,19 @@ }, "home-manager": { "inputs": { - "nixpkgs": [ - "nixpkgs" - ] + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1736066484, - "narHash": "sha256-uTstP36WaFrw+TEHb8nLF14hFPzQBOhmIxzioHCDaL8=", + "lastModified": 1736373539, + "narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=", "owner": "nix-community", "repo": "home-manager", - "rev": "5ad12b6ea06b84e48f6b677957c74f32d47bdee0", + "rev": "bd65bc3cde04c16755955630b344bc9e35272c56", "type": "github" }, "original": { "owner": "nix-community", + "ref": "release-24.11", "repo": "home-manager", "type": "github" } @@ -247,6 +246,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1736200483, + "narHash": "sha256-JO+lFN2HsCwSLMUWXHeOad6QUxOuwe9UOAF/iSl1J4I=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3f0a8ac25fb674611b98089ca3a5dd6480175751", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1736200483, "narHash": "sha256-JO+lFN2HsCwSLMUWXHeOad6QUxOuwe9UOAF/iSl1J4I=", @@ -262,7 +277,7 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_3": { "locked": { "lastModified": 1735648875, "narHash": "sha256-fQ4k/hyQiH9RRPznztsA9kbcDajvwV1sRm01el6Sr3c=", @@ -282,7 +297,7 @@ "inputs": { "home-manager": "home-manager", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "stylix": "stylix" } }, @@ -297,7 +312,7 @@ "git-hooks": "git-hooks", "gnome-shell": "gnome-shell", "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "systems": "systems", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", diff --git a/flake.nix b/flake.nix index a653dfc..42694a5 100644 --- a/flake.nix +++ b/flake.nix @@ -5,11 +5,7 @@ nixos-hardware.url = "github:NixOS/nixos-hardware/master"; stylix.url = "github:danth/stylix"; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; - - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + home-manager.url = "github:nix-community/home-manager/release-24.11"; }; outputs = { @@ -34,6 +30,15 @@ ]; }; + desktop = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs;}; + modules = [ + ./hosts/desktop/configuration.nix + inputs.home-manager.nixosModules.default + inputs.stylix.nixosModules.stylix + ]; + }; + server = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs;}; modules = [ diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix new file mode 100644 index 0000000..420750c --- /dev/null +++ b/hosts/desktop/configuration.nix @@ -0,0 +1,114 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). +{ + config, + pkgs, + inputs, + nixos-hardware, + ... +}: { + imports = [./hardware-configuration.nix]; + hardware.steam-hardware.enable = true; + + networking = { + hostName = "desktop"; + networkmanager.enable = true; + firewall.enable = false; + }; + + nix = { + gc.automatic = true; + settings = { + experimental-features = ["nix-command" "flakes"]; + substituters = ["http://nix.dhilton.xyz/" "https://cache.nixos.org/"]; + trusted-public-keys = ["nix.dhilton.xyz:MOW060dF1A0/UXmPZBue9KMxCO13PHYFwx1X9hcdYZ4="]; + }; + }; + + services = { + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + wivrn = { + enable = true; + defaultRuntime = true; + }; + xserver.enable = true; + displayManager.sddm.enable = true; + desktopManager.plasma6.enable = true; + }; + + stylix = { + enable = true; + autoEnable = true; + polarity = "dark"; + image = ./wallpaper.png; + base16Scheme = "${pkgs.base16-schemes}/share/themes/everforest.yaml"; + opacity = { + terminal = 0.85; + popups = 0.75; + desktop = 0.75; + }; + cursor = { + package = pkgs.adwaita-icon-theme; + name = "Adwaita"; + size = 28; + }; + fonts = { + serif = { + package = pkgs.nerdfonts; + name = "Iosevka NF"; + }; + + sansSerif = { + package = pkgs.nerdfonts; + name = "Iosevka NF"; + }; + + monospace = { + package = pkgs.nerdfonts; + name = "Iosevka NFM"; + }; + }; + }; + + i18n = { + defaultLocale = "en_US.UTF-8"; + extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + }; + + hardware = { + graphics.enable32Bit = true; + }; + + programs = { + zsh.enable = true; + wivrn.enable = true; + opencomposite.enable = true; + steam.enable = true; + gamescope.enable = true; + } + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "23.11"; # Did you read the comment? +} diff --git a/hosts/desktop/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix new file mode 100644 index 0000000..0d0787f --- /dev/null +++ b/hosts/desktop/hardware-configuration.nix @@ -0,0 +1 @@ +##TODO diff --git a/hosts/desktop/home.nix b/hosts/desktop/home.nix new file mode 100644 index 0000000..a15c042 --- /dev/null +++ b/hosts/desktop/home.nix @@ -0,0 +1,9 @@ +{ + config, + pkgs, + inputs, + ... +}: { + imports = [../home/home_common.nix]; + home = {packages = with pkgs; [steam wivrn opencomposite neovim];}; +} diff --git a/hosts/home/home_common.nix b/hosts/home/home_common.nix index e0707b3..e13b2e3 100644 --- a/hosts/home/home_common.nix +++ b/hosts/home/home_common.nix @@ -8,7 +8,6 @@ username = "k"; homeDirectory = "/home/k"; stateVersion = "23.11"; - enableNixpkgsReleaseCheck = false; }; programs = { git = { diff --git a/hosts/home/hyprland.nix b/hosts/home/hyprland.nix index 06ab1cc..abec126 100644 --- a/hosts/home/hyprland.nix +++ b/hosts/home/hyprland.nix @@ -5,7 +5,19 @@ ... }: { imports = [./waybar.nix ./tile.nix]; - programs = {hyprlock = {enable=true;};}; + home.packages = with pkgs; [ + hyprlock + hyprpaper + iio-hyprland + batsignal + jq #iio-hyprland needs this + ]; + + services = { + hypridle.enable=true; + hyprpaper.enable=true; + }; + wayland.windowManager.hyprland = { enable = true; systemd.variables = ["--all"]; @@ -13,8 +25,8 @@ settings = { exec-once = [ - "${pkgs.hyprpaper}/bin/hyprpaper" "${pkgs.iio-hyprland}/bin/iio-hyprland" + "${pkgs.batsignal}/bin/batsignal -n BAT0 -b" ]; monitor = "eDP-1,preferred,auto,1"; general = { diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 78c556f..5102a91 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -65,14 +65,17 @@ enable = true; package = pkgs.ollama-intel; }; - tlp = { + auto-cpufreq = { enable = true; settings = { - CPU_SCALING_GOVERNOR_ON_AC = "performance"; - CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; - - CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; - CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + battery = { + governor = "powersave"; + turbo = "never"; + }; + charger = { + governor = "balance_performance"; + turbo = "auto"; + }; }; }; logind = { @@ -117,11 +120,6 @@ package = pkgs.nerdfonts; name = "Iosevka NFM"; }; - - # emoji = { - # package = pkgs.notofonts; - # name = "Noto Color Emoji"; - # }; }; }; diff --git a/hosts/server/configuration.nix b/hosts/server/configuration.nix index 7bf6192..5b666ef 100644 --- a/hosts/server/configuration.nix +++ b/hosts/server/configuration.nix @@ -5,10 +5,9 @@ ... }: { imports = [./hardware-configuration.nix ./service.nix]; - powerManagement.enable = false; + powerManagement.enable = true; system.autoUpgrade.enable = true; networking.networkmanager.enable = true; - boot.kernelParams = ["intel_pstate=active"]; nix = { gc.automatic = true; @@ -18,13 +17,17 @@ trusted-public-keys = ["nix.dhilton.xyz:MOW060dF1A0/UXmPZBue9KMxCO13PHYFwx1X9hcdYZ4="]; }; }; - nixpkgs.config.allowUnfree = true; + + nixpkgs.config = { + allowUnfree = true; + vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; + }; programs = { - nix-ld.enable = true; - nix-ld.libraries = with pkgs; [glibc glib]; zsh.enable = true; + neovim.enable = true; }; + users = { motd = "Welcome to the Server"; defaultUserShell = pkgs.zsh; @@ -56,17 +59,15 @@ hardware.graphics = { enable = true; extraPackages = with pkgs; [ - intel-compute-runtime intel-media-driver - vaapiIntel + intel-vaapi-driver vaapiVdpau - libvdpau-va-gl - vpl-gpu-rt + intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in) + vpl-gpu-rt # QSV on 11th gen or newer + intel-media-sdk # QSV up to 11th gen ]; }; - services.xserver.videoDrivers = ["intel"]; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/hosts/server/home.nix b/hosts/server/home.nix index 22dc964..3b1a21b 100644 --- a/hosts/server/home.nix +++ b/hosts/server/home.nix @@ -5,5 +5,5 @@ ... }: { imports = [../home/home_common.nix]; - home = {packages = with pkgs; [docker docker-compose];}; + home = {packages = with pkgs; [docker docker-compose neovim];}; } diff --git a/hosts/server/service.nix b/hosts/server/service.nix index b9354a4..55fc65c 100644 --- a/hosts/server/service.nix +++ b/hosts/server/service.nix @@ -5,8 +5,8 @@ }: { networking.firewall = { enable = true; - allowedTCPPorts = [80 443 22 26615 25565 24454 8080 53]; - allowedUDPPorts = [26615 25565 24454 8080 53]; + allowedTCPPorts = [80 443 22]; + allowedUDPPorts = []; }; security.acme = { @@ -37,46 +37,6 @@ package = pkgs.ollama-intel; }; - crab-hole = { - enable = true; - settings = { - api = { - listen = "192.168.0.2"; - port = 8080; - show_doc = true; - }; - downstream = [ - { - listen = "192.168.0.2"; - port = 53; - protocol = "udp"; - } - ]; - upstream = { - name_servers = [ - { - protocol = "tls"; - socket_addr = "[2606:4700:4700::1111]:853"; - tls_dns_name = "1dot1dot1dot1.cloudflare-dns.com"; - trust_nx_responses = false; - } - { - protocol = "tls"; - socket_addr = "1.1.1.1:853"; - tls_dns_name = "1dot1dot1dot1.cloudflare-dns.com"; - trust_nx_responses = false; - } - ]; - }; - blocklist.lists = [ - "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts" - "https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt" - "https://raw.githubusercontent.com/anudeepND/blacklist/master/CoinMiner.txt" - "https://www.github.developerdan.com/hosts/lists/ads-and-tracking-extended.txt" - ]; - }; - }; - gitea = { enable = true; settings = { @@ -114,7 +74,7 @@ http = { use_x_forwarded_for = "true"; trusted_proxies = ["127.0.0.1"]; - server_port = 8003; + server_port = 8002; }; }; }; @@ -135,7 +95,7 @@ searx = { enable = true; settings = { - server.port = 8005; + server.port = 8003; server.secret_key = "secretlol"; search.formats = ["html" "json"]; }; @@ -191,29 +151,20 @@ }; }; - "srx.dhilton.xyz" = { - forceSSL = true; - enableACME = true; - locations."/" = { - proxyPass = "http://127.0.0.1:8005"; - proxyWebsockets = true; - }; - }; - "hom.dhilton.xyz" = { forceSSL = true; enableACME = true; locations."/" = { - proxyPass = "http://127.0.0.1:8003"; + proxyPass = "http://127.0.0.1:8002"; proxyWebsockets = true; }; }; - "map.dhilton.xyz" = { + "srx.dhilton.xyz" = { forceSSL = true; enableACME = true; locations."/" = { - proxyPass = "http://127.0.0.1:8100"; + proxyPass = "http://127.0.0.1:8003"; proxyWebsockets = true; }; };