diff --git a/flake.lock b/flake.lock index 5b9268c..02d8427 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,17 @@ { "nodes": { + "currentSystem": { + "locked": { + "lastModified": 1717562249, + "narHash": "sha256-WdcVxEl64ZRLVUmnn9ZVXBId0eGkzxwZSVDxZDy0mgU=", + "path": "/etc/nixos/hostname", + "type": "path" + }, + "original": { + "path": "/etc/nixos/hostname", + "type": "path" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -22,11 +34,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1717196966, - "narHash": "sha256-yZKhxVIKd2lsbOqYd5iDoUIwsRZFqE87smE2Vzf6Ck0=", + "lastModified": 1717602782, + "narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "57610d2f8f0937f39dbd72251e9614b1561942d8", + "rev": "e8057b67ebf307f01bdcc8fba94d94f75039d1f6", "type": "github" }, "original": { @@ -38,6 +50,7 @@ }, "root": { "inputs": { + "currentSystem": "currentSystem", "home-manager": "home-manager", "nixpkgs": "nixpkgs" } diff --git a/flake.nix b/flake.nix index 16bcc12..c2c9712 100644 --- a/flake.nix +++ b/flake.nix @@ -2,14 +2,17 @@ description = "NixOS configuration"; inputs = { + currentSystem.url = "path:/etc/nixos/hostname"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = inputs@{ self, nixpkgs, home-manager, ... }: let + outputs = inputs@{ self, currentSystem, nixpkgs, home-manager, ... }: let inherit (self) outputs; + hostname = currentSystem.hostname; + configs."ankaa" = { system = "x86_64-linux"; @@ -40,7 +43,7 @@ easyeffects = true; }; }; - + gui = { enable = true; protonmail = true; @@ -69,7 +72,10 @@ }; - games.enable = true; + games = { + enable = true; + lutris.enable = true; + }; common.nil.enable = true; @@ -109,54 +115,44 @@ }; - hostname = - if (builtins.pathExists ./hostname) then - builtins.readFile(./hostname) - else - "default-hostname"; - utils = import ./utils; system = configs."${hostname}".system; pkgs = nixpkgs.legacyPackages.${system}; - - in { - nixosConfigurations = { - "${hostname}" = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit (outputs) localPackages; - }; - modules = [ - { - networking.hostName = hostname; - } - (import ./modules/nix) - { - simmer = configs."${hostname}"; - } - (./. + "/hosts/${hostname}/system.nix") - (./. + "/hosts/${hostname}/hardware-configuration.nix") - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = { - systemConfig = configs."${hostname}"; - inherit utils; - }; + nixosConfigurations = { + "${hostname}" = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit (outputs) localPackages; + }; + modules = [ + { + networking.hostName = hostname; + simmer = configs."${hostname}"; + } + (import ./modules/nix) + (./. + "/hosts/${hostname}/system.nix") + (./. + "/hosts/${hostname}/hardware-configuration.nix") + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { + inherit utils; + systemConfig = configs."${hostname}"; + }; - home-manager.users.eesim = import (./. + "/hosts/${hostname}/home.nix"); - } - ]; + home-manager.users.eesim = import (./. + "/hosts/${hostname}/home.nix"); + } + ]; + }; }; + localPackages = nixpkgs.lib.genAttrs [ "x86_64-linux" ] (system: + { + kickoff-dot-desktop = pkgs.callPackage ./pkgs/kickoff-dot-desktop.nix {}; + gamescope-old = pkgs.callPackage ./pkgs/gamescope-old {}; + gamescope-dbg = pkgs.callPackage ./pkgs/gamescope-dbg {}; + } + ); }; - localPackages = nixpkgs.lib.genAttrs [ "x86_64-linux" ] (system: - { - kickoff-dot-desktop = pkgs.callPackage ./pkgs/kickoff-dot-desktop.nix { }; - gamescope-old = pkgs.callPackage ./pkgs/gamescope-old {}; - gamescope-dbg = pkgs.callPackage ./pkgs/gamescope-dbg {}; - } - ); - }; } diff --git a/modules/home/sway.nix b/modules/home/sway.nix index 9822160..c21cf0b 100644 --- a/modules/home/sway.nix +++ b/modules/home/sway.nix @@ -7,20 +7,11 @@ }: with lib; let - cfg = config.simmer.sway; gui = systemConfig.gui; modifier = "Mod4"; in { - options.simmer.sway = { - enable = mkOption { - description = "Whether to install and set sway as window manager"; - type = types.bool; - default = gui.enable; - }; - }; - - config = mkIf cfg.enable { + config = mkIf gui.sway.enable { wayland.windowManager.sway = { enable = true; checkConfig = false; @@ -144,11 +135,10 @@ in ]; "6" = [ - {app_id="com.obsproject.Studio"; } ]; "7" = [ - {app_id="org.strawberrymusicplayer.strawberry"; } + {class="feishin"; } ]; "8" = [ @@ -159,10 +149,7 @@ in "9" = []; - "0" = [ - {app_id="python3"; } - {class="steam_proton"; } - ]; + "0" = []; }; input."type:keyboard" = { diff --git a/modules/nix/audio.nix b/modules/nix/audio.nix index 3718002..7091800 100644 --- a/modules/nix/audio.nix +++ b/modules/nix/audio.nix @@ -16,16 +16,6 @@ in type = types.bool; default = false; }; - pulseSupport = mkOption { - description = "Enable pulse support for pipewire"; - type = types.bool; - default = true; - }; - alsaSupport = mkOption { - description = "Enable alsa support for pipewire"; - type = types.bool; - default = true; - }; }; music = { @@ -56,23 +46,22 @@ in }; config = { - environment.systemPackages = - with pkgs; [] + environment.systemPackages = with pkgs; [] + ++ optional cfg.pipewire.enable pulseaudio + ++ optional cfg.music.enable feishin ++ optional cfg.tools.helvum helvum ++ optional cfg.tools.easyeffects easyeffects - ++ optional cfg.tools.pavucontrol pavucontrol - ++ optional cfg.pipewire.pulseSupport pulseaudio - ++ optional cfg.music.enable feishin; + ++ optional cfg.tools.pavucontrol pavucontrol; security.rtkit.enable = mkIf cfg.pipewire.enable true; services.pipewire = mkIf cfg.pipewire.enable { enable = true; - alsa = mkIf cfg.pipewire.alsaSupport { + alsa = { enable = true; support32Bit = true; }; - pulse.enable = mkIf cfg.pipewire.pulseSupport true; + pulse.enable = true; }; }; } diff --git a/modules/nix/backup.nix b/modules/nix/backup.nix index f3b7d29..e485aad 100644 --- a/modules/nix/backup.nix +++ b/modules/nix/backup.nix @@ -38,7 +38,7 @@ in }; passphrase = mkOption { - description = "path to file containing passphrase"; + description = "Path to file containing passphrase"; type = types.path; }; diff --git a/modules/nix/common.nix b/modules/nix/common.nix index 9c51fa1..d585e66 100644 --- a/modules/nix/common.nix +++ b/modules/nix/common.nix @@ -20,7 +20,7 @@ in nil.enable = mkOption { description = "Whether to install nil"; type = types.bool; - default = false; + default = true; }; shell = mkOption { diff --git a/modules/nix/games.nix b/modules/nix/games.nix index 97e1073..9fbc51e 100644 --- a/modules/nix/games.nix +++ b/modules/nix/games.nix @@ -47,12 +47,11 @@ in }; config = mkIf cfg.enable { - environment.systemPackages = with pkgs; with localPackages.x86_64-linux; - [] - ++ optional cfg.protonup.enable protonup-qt - ++ optional cfg.gamescope.enable gamescope-old - ++ optional cfg.discord.enable vesktop - ++ optionals cfg.lutris.enable [ lutris wine ]; + environment.systemPackages = with pkgs; with localPackages.x86_64-linux; [] + ++ optional cfg.protonup.enable protonup-qt + ++ optional cfg.gamescope.enable gamescope-old + ++ optional cfg.discord.enable vesktop + ++ optionals cfg.lutris.enable [ lutris wine ]; programs.steam = mkIf cfg.steam.enable { enable = true; diff --git a/modules/nix/gui.nix b/modules/nix/gui.nix index db8631b..028fbd0 100644 --- a/modules/nix/gui.nix +++ b/modules/nix/gui.nix @@ -103,8 +103,8 @@ in packages = with pkgs; [ liberation_ttf ubuntu_font_family - font-awesome vazir-fonts + font-awesome ]; fontconfig = { diff --git a/pkgs/gamescope-dbg/default.nix b/pkgs/gamescope-dbg/default.nix index 984947b..904d007 100644 --- a/pkgs/gamescope-dbg/default.nix +++ b/pkgs/gamescope-dbg/default.nix @@ -50,9 +50,9 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "ValveSoftware"; repo = "gamescope"; - rev = "0065946d1bf69584714a17698947ab80a97128bc"; + rev = "420eb91387a484fd7b1ea71449091f0480d9e538"; fetchSubmodules = true; - hash = "sha256-PiDXHq7/CxIOday5DQyAG6i3+ggm6zp3iSPIhq63EOk="; + hash = "sha256-XcefR0wiDHQY7wMX+LQTEntffi2RdMW8m2HNQMz035A="; }; patches = [ @@ -144,11 +144,11 @@ stdenv.mkDerivation (finalAttrs: { --add-needed ${libgcc.lib}/lib/libasan.so.8 \ --add-needed libvulkan.so.1 - LD_PRELOAD="${libgcc.lib}/lib/libasan.so.8" - # --debug-layers flag expects these in the path wrapProgram "$out/bin/gamescope" \ - --prefix PATH : ${with xorg; lib.makeBinPath [xprop xwininfo]} + --prefix PATH : ${with xorg; lib.makeBinPath [xprop xwininfo]} \ + --set ASAN_OPTIONS "halt_on_error=false" \ + --set LD_PRELOAD "${libgcc.lib}/lib/libasan.so.8" # Install ReShade shaders mkdir -p $out/share/gamescope/reshade