diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 62524cb..06dc541 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,58 +1,34 @@ # by https://github.com/danth/stylix/blob/master/.github/workflows/docs.yml name: Docs - on: push: branches: - main - jobs: build: name: Build - permissions: contents: read - - runs-on: ubuntu-latest - + runs-on: nixos-latest steps: - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - extra-conf: | - extra-experimental-features = nix-command flakes pipe-operators - - - name: Set up cache - uses: DeterminateSystems/magic-nix-cache-action@main - + - name: Nix Config + run: | + mkdir -p $HOME/.config + mkdir -p $HOME/.config/nix + echo experimental-features = nix-command flakes pipe-operators >> $HOME/.config/nix/nix.conf + echo access-tokens = github.com=${{ secrets.GITHUBTOKEN }} >> $HOME/.config/nix/nix.conf + nix profile install nixpkgs#nodejs - name: Build docs - run: nix -L build github:${{ github.repository }}/${{ github.sha }}#docs --no-write-lock-file - + run: nix -L build git+https://git.dashie.org/${{ forgejo.repository }}.git?rev=${{ forgejo.sha }}#docs --no-write-lock-file - name: Prepare docs for upload run: cp -r --dereference --no-preserve=mode,ownership result/ public/ - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + # - name: Upload artifact + # uses: https://data.forgejo.org/forgejo/upload-artifact@v4 + # with: + # path: public/ + - name: Publish Page + uses: https://data.forgejo.org/actions/git-pages@v2 with: - path: public/ - - deploy: - name: Deploy - - needs: build - - permissions: - pages: write - id-token: write - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - runs-on: ubuntu-latest - - steps: - - name: Deploy docs to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + site: https://username.pages.dashie.org/reponame/ + token: ${{ forge.token }} + source: public/ diff --git a/base/common_hardware.nix b/base/common_hardware.nix index 56a6dc6..9f7ccf1 100644 --- a/base/common_hardware.nix +++ b/base/common_hardware.nix @@ -101,10 +101,6 @@ in { builders-use-substitutes = mkDashDefault true; - substituters = [ - "https://chaotic-nyx.cachix.org/" - ]; - trusted-substituters = [ "https://hyprland.cachix.org" "https://anyrun.cachix.org" @@ -128,7 +124,6 @@ in { "oxicalc.cachix.org-1:qF3krFc20tgSmtR/kt6Ku/T5QiG824z79qU5eRCSBTQ=" "hyprdock.cachix.org-1:HaROK3fBvFWIMHZau3Vq1TLwUoJE8yRbGLk0lEGzv3Y=" "reset.cachix.org-1:LfpnUUdG7QM/eOkN7NtA+3+4Ar/UBeYB+3WH+GjP9Xo=" - "chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8=" "dashvim.cachix.org-1:uLRdxp1WOWHnsZZtu3SwUWZRsvC7SXo0Gyk3tIefuL0=" ]; @@ -164,6 +159,8 @@ in { "vboxusers" "video" "audio" + "scanner" + "lp" ]; packages = with pkgs; [ home-manager diff --git a/docs/src/README.md b/docs/src/README.md index 6233312..3658e00 100644 --- a/docs/src/README.md +++ b/docs/src/README.md @@ -23,6 +23,40 @@ dashNix = { You can then configure your systems in your flake outputs with a provided library command: +Please note that overriding inputs will invalidate the cache configuration, this means you will have to add this manually: + +```nix + builders-use-substitutes = true; + + extra-substituters = [ + "https://hyprland.cachix.org" + "https://anyrun.cachix.org" + "https://cache.garnix.io" + "https://oxipaste.cachix.org" + "https://oxinoti.cachix.org" + "https://oxishut.cachix.org" + "https://oxidash.cachix.org" + "https://oxicalc.cachix.org" + "https://hyprdock.cachix.org" + "https://reset.cachix.org" + "https://dashvim.cachix.org" + ]; + + extra-trusted-public-keys = [ + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + "oxipaste.cachix.org-1:n/oA3N3Z+LJP7eIWOwuoLd9QnPyZXqFjLgkahjsdDGc=" + "oxinoti.cachix.org-1:dvSoJl2Pjo5HMaNngdBbSaixK9BSf2N8gzjP2MdGvfc=" + "oxishut.cachix.org-1:axyAGF3XMh1IyMAW4UMbQCdMNovDH0KH6hqLLRJH8jU=" + "oxidash.cachix.org-1:5K2FNHp7AS8VF7LmQkJAUG/dm6UHCz4ngshBVbjFX30=" + "oxicalc.cachix.org-1:qF3krFc20tgSmtR/kt6Ku/T5QiG824z79qU5eRCSBTQ=" + "hyprdock.cachix.org-1:HaROK3fBvFWIMHZau3Vq1TLwUoJE8yRbGLk0lEGzv3Y=" + "reset.cachix.org-1:LfpnUUdG7QM/eOkN7NtA+3+4Ar/UBeYB+3WH+GjP9Xo=" + "dashvim.cachix.org-1:uLRdxp1WOWHnsZZtu3SwUWZRsvC7SXo0Gyk3tIefuL0=" + ]; +``` + ```nix nixosConfigurations = inputs.dashNix.dashNixLib.buildSystems { root = ./.; }; ``` @@ -74,26 +108,20 @@ Here is a minimal required configuration.nix (the TODOs mention a required chang # default disk config has root home boot and swap partition, overwrite if you want something different sops.enable = false; nextcloud.enable = false; - hypr.hyprland = { - # TODO monitor configuration for hyprland (hyprland is default) - # should be something like DP-1 - defaultMonitor = "YOURMONITOR"; - # width x height @ refreshrate - defaultMonitorMode = "1920x1080@60"; - # scale for your main monitor - defaultMonitorScale = "1"; - # additional configruation can be done as well - # customConfig = { - # monitor = [ - # # default - # "${config.mods.hypr.hyprland.defaultMonitor},${config.mods.hypr.hyprland.defaultMonitorMode},0x0,${config.mods.hypr.hyprland.defaultMonitorScale}" - # # second example monitor - # "DP-2,3440x1440@180,auto,1" - # # all others - # ",highrr,auto,1" - # ]; - # } - }; + wm.monitors = [ + # Example + # { + # name = "DP-1"; + # resolutionX = 3440; + # resolutionY = 1440; + # refreshrate = 180; + # positionX = 2560; + # positionY = 0; + # scale = 1; + # transform = "0"; + # vrr = false; + # } + ]; gpu.nvidia.enable = true; kdeConnect.enable = true; # login manager: @@ -102,29 +130,29 @@ Here is a minimal required configuration.nix (the TODOs mention a required chang # sddm = { }; # gdm = { }; drives = { - # default assumes ROOT, BOOT, HOME and SWAP labaled drives exist - # for an example without HOME see below - # defaultDrives.enable = false; - # extraDrives = [ - # { - # name = "boot"; - # drive = { - # device = "/dev/disk/by-label/BOOT"; - # fsType = "vfat"; - # options = [ "rw" "fmask=0022" "dmask=0022" "noatime" ]; - # }; - # } - # { - # name = ""; - # drive = { - # device = "/dev/disk/by-label/ROOT"; - # fsType = "ext4"; - # options = [ "noatime" "nodiratime" "discard" ]; - # }; - # } - # ]; - # You can also use disko to format your disks on installation. - # Please refer to the Documentation about the drives module for an example. + # default assumes ROOT, BOOT, HOME and SWAP labaled drives exist + # for an example without HOME see below + # defaultDrives.enable = false; + # extraDrives = [ + # { + # name = "boot"; + # drive = { + # device = "/dev/disk/by-label/BOOT"; + # fsType = "vfat"; + # options = [ "rw" "fmask=0022" "dmask=0022" "noatime" ]; + # }; + # } + # { + # name = ""; + # drive = { + # device = "/dev/disk/by-label/ROOT"; + # fsType = "ext4"; + # options = [ "noatime" "nodiratime" "discard" ]; + # }; + # } + # ]; + # You can also use disko to format your disks on installation. + # Please refer to the Documentation about the drives module for an example. }; }; } @@ -134,68 +162,78 @@ Here is a minimal required configuration.nix (the TODOs mention a required chang After logging in the first time, your password will be set to "firstlogin", please change this to whatever you like. -## Nixos and Home-manager Modules +## Configuring pkgs -You can add additional modules or remove all of them by overriding parameters to the buildSystems command: +While DashNix offers a default pkgs config, you may want to permit an unsecure packages, +add additional modules/inputs, or add an overlay to them. +You can configure both stable and unstable pkgs the following way: + +Please note that modules and inputs are merged together to ensure functionality. ```nix -nixosConfigurations = - let - additionalMods = { - nixos = [ - # your modules - ]; home = [ - # your modules - ]; - } - # passing this parameter will override the existing modules - mods = { - nixos = []; - home = []; - } - in - inputs.dashNix.dashNixLib.buildSystems { root = ./.; inherit mods additionalMods; }; +currentSystem = "x86_64-linux"; +permittedPackages = [ + "some package" +]; +config = { + system = currentSystem; + config = { + allowUnfree = true; + permittedInsecurePackages = permittedPackages; + }; + inputs = { + # Some inputs + } + mods = { + home = [ + # Some home manager module + ]; + nixos = [ + # Some nixos module + ]; +} +}; +unstableBundle = { + pkgs = inputs.unstable; + inherit config mods; +}; +inputs.dashNix.dashNixLib.buildSystems { + root = ./.; + inherit unstableBundle; +} ``` -## Additional Inputs - -Just like modules, you can add additional inputs to your configuration. - -```nix -nixosConfigurations = - let - additionalInputs = { - something.url = "yoururl" - } - in - inputs.dashNix.dashNixLib.buildSystems { root = ./.; inherit additionalInputs; }; -``` +With this you could also change your input to something different should you wish to do so. +Note that overriding inputs via the flake still works, +this way however ensures you can also configure the inputs. ## Stable/Unstable Sometimes you want to differentiate between systems that are stable and unstable, e.g. for servers and desktops/laptops. This can be done with the overridePkgs flag for the lib function: +(overridePkgs simply inverts the default bundle that is used for the nix standard library as well as NixOS itself) + ```nix - nixosConfigurations = - inputs.dashNix.dashNixLib.buildSystems { - root = ./stable; - inherit additionalInputs; - overridePkgs = true; - } - // inputs.dashNix.dashNixLib.buildSystems { - root = ./unstable; - inherit additionalInputs; - }; +nixosConfigurations = + inputs.dashNix.dashNixLib.buildSystems { + root = ./stable; + inherit stableBundle; + overridePkgs = true; + } + // inputs.dashNix.dashNixLib.buildSystems { + inherit unstableBundle; + root = ./unstable; + }; ``` You can now place your systems in the respective directories. Keep in mind that the hosts directory will still need to exist in each variant. E.g. stable/hosts/yourserver and unstable/hosts/yourdesktop -# Installation +# Installation via ISO -You can find a custom ISO on my NextCloud server: [Link](https://cloud.dashie.org/s/z7G3zS9SXeEt2ERD). +You can find a custom ISO in the releases: [Link](https://github.com/Xetibo/DashNix/releases). With this, you will receive the example config in /iso/example alongside the gnome desktop environment, as well as a few tools like gnome-disks, Neovim, Vscodium, a browser etc. @@ -214,19 +252,30 @@ Then configure as you please and choose a command below depending on your disk i Installation via manual configuration: ```sh -sudo nixos-install --flake # --root +sudo nixos-install --flake # --root --option experimental-features "nix-command flakes pipe-operators" #example -#nixos-install --flake ~/config#globi --root /mnt +#nixos-install --flake ~/config#globi --root /mnt --option experimental-features "nix-command flakes pipe-operators" ``` Installation via disko: ```sh -sudo disko-install --flake # --disk +sudo disko-install --flake # --disk --option experimental-features "nix-command flakes pipe-operators" #example -#disko-install -- --flake ~/config#globi --disk main /dev/nvme0n1 +#disko-install -- --flake ~/config#globi --disk main /dev/nvme0n1 --option experimental-features "nix-command flakes pipe-operators" ``` +# Installation via flake + +If you already have nix installed, you can instead just copy the default config onto your system and install DashNix with it. +To create the example config for a base to start with, you can just run this flake with the mkFlake command: + +```sh +nix run github:Xetibo/DashNix#mkFlake +``` + +This command will put the default configuration into $HOME/gits/nixos + # Modules This configuration features several modules that can be used as preconfigured "recipies". @@ -234,6 +283,7 @@ These modules attempt to combine the home-manager and nixos packages/options to For package lists, please check the individual modules, as the lists can be long. - Hyprland: Installs and configures Hyprland with various additional packages +- Niri: Installs and configures Niri with various additional packages - acpid : Enables the acpid daemon - base packages : A list of system packages to be installed by default - bluetooth : Configures/enables bluetooth and installs tools for bluetooth @@ -276,3 +326,4 @@ For package lists, please check the individual modules, as the lists can be long - [chermnyx](https://github.com/chermnyx) for providing a base for zen configuration - [voronind-com](https://github.com/voronind-com) for providing the darkreader configuration - [Nix-Artwork](https://github.com/NixOS/nixos-artwork/tree/master/logo) for the Nix/NixOS logo (Tim Cuthbertson (@timbertson)) +- [xddxdd](https://github.com/xddxdd) for the CachyOS-Kernel flake diff --git a/example/flake.nix b/example/flake.nix index 129fc20..01ec944 100644 --- a/example/flake.nix +++ b/example/flake.nix @@ -31,7 +31,6 @@ "https://oxicalc.cachix.org" "https://hyprdock.cachix.org" "https://reset.cachix.org" - "https://chaotic-nyx.cachix.org/" "https://dashvim.cachix.org" ]; @@ -46,7 +45,6 @@ "oxicalc.cachix.org-1:qF3krFc20tgSmtR/kt6Ku/T5QiG824z79qU5eRCSBTQ=" "hyprdock.cachix.org-1:HaROK3fBvFWIMHZau3Vq1TLwUoJE8yRbGLk0lEGzv3Y=" "reset.cachix.org-1:LfpnUUdG7QM/eOkN7NtA+3+4Ar/UBeYB+3WH+GjP9Xo=" - "chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8=" "dashvim.cachix.org-1:uLRdxp1WOWHnsZZtu3SwUWZRsvC7SXo0Gyk3tIefuL0=" ]; }; diff --git a/example/hosts/example/configuration.nix b/example/hosts/example/configuration.nix index 5d9e612..dbe8cd0 100644 --- a/example/hosts/example/configuration.nix +++ b/example/hosts/example/configuration.nix @@ -18,26 +18,20 @@ # default disk config has root home boot and swap partition, overwrite if you want something different sops.enable = false; nextcloud.enable = false; - hypr.hyprland = { - # TODO monitor configuration for hyprland (hyprland is default) - # should be something like DP-1 - defaultMonitor = "YOURMONITOR"; - # width x height @ refreshrate - defaultMonitorMode = "1920x1080@60"; - # scale for your main monitor - defaultMonitorScale = "1"; - # additional configruation can be done as well - # customConfig = { - # monitor = [ - # # default - # "${config.mods.hypr.hyprland.defaultMonitor},${config.mods.hypr.hyprland.defaultMonitorMode},0x0,${config.mods.hypr.hyprland.defaultMonitorScale}" - # # second example monitor - # "DP-2,3440x1440@180,auto,1" - # # all others - # ",highrr,auto,1" - # ]; + wm.monitors = [ + # Example + # { + # name = "DP-1"; + # resolutionX = 3440; + # resolutionY = 1440; + # refreshrate = 180; + # positionX = 2560; + # positionY = 0; + # scale = 1; + # transform = "0"; + # vrr = false; # } - }; + ]; gpu.nvidia.enable = true; kdeConnect.enable = true; # login manager: diff --git a/flake.nix b/flake.nix index 665829b..be1d5c2 100644 --- a/flake.nix +++ b/flake.nix @@ -18,10 +18,11 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "unstable"; }; + cachy.url = "github:xddxdd/nix-cachyos-kernel?rev=bb7b8aa687464f24dcd452354d9621331d6b0737"; sops-nix.url = "github:Mic92/sops-nix"; - hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; + hyprland.url = "github:hyprwm/Hyprland"; ironbar = { url = "github:JakeStanger/ironbar"; @@ -49,9 +50,6 @@ superfreq.url = "github:NotAShelf/superfreq"; - # absolute insanity - chaoticNyx.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; - compose.url = "github:garnix-io/nixos-compose"; }; @@ -59,47 +57,27 @@ currentSystem = "x86_64-linux"; permittedPackages = [ "olm-3.2.16" - # well done dotnet... - # this is just for omnisharp - "dotnet-core-combined" - "dotnet-wrapped-combined" - "dotnet-combined" - "dotnet-sdk-6.0.428" - "dotnet-sdk-wrapped-6.0.428" - "dotnet-sdk-6.0.136" - "dotnet-sdk-wrapped-6.0.136" - "dotnet-sdk-7.0.120" - "dotnet-sdk-wrapped-7.0.120" - "dotnet-sdk-7.0.410" - "dotnet-sdk-wrapped-7.0.410" - "jitsi-meet-1.0.8043" - "nextcloud-27.1.11" ]; - stable = import ./lib/importPkgs.nix { - inherit inputs permittedPackages currentSystem; - pkgs = inputs.stable; - }; - unstable = import ./lib/importPkgs.nix { - inherit inputs permittedPackages currentSystem; - pkgs = inputs.unstable; - }; - pkgsDarkreader = import ./lib/importPkgs.nix { - inherit inputs permittedPackages currentSystem; - pkgs = inputs.pkgsDarkreader; - }; + importPkgsFn = import ./lib/importPkgs.nix; + defaultConfigureFn = pkgs: + importPkgsFn { + inherit inputs currentSystem permittedPackages pkgs; + }; + stable = defaultConfigureFn inputs.stable; + unstable = defaultConfigureFn inputs.unstable; + pkgsDarkreader = defaultConfigureFn inputs.pkgsDarkreader; in rec { dashNixLib = import ./lib { inherit self inputs unstable - stable + permittedPackages ; dashNixAdditionalProps = { inherit pkgsDarkreader; }; system = currentSystem; - inherit (inputs.unstable) lib; }; docs = import ./docs { inherit inputs; @@ -116,5 +94,20 @@ modules = ./modules; iso = dashNixLib.buildIso.config.system.build.isoImage; nixosConfigurations = dashNixLib.buildSystems {root = ./example/.;}; + + mkFlake = stablePkgs.writeShellApplication { + name = "Create example config"; + text = + /* + bash + */ + '' + mkdir -p ~/gits/nixos + mkdir -p ~/gits/backup_nixos + + mv ~/gits/nixos/* ~/gits/backup_nixos/ + cp -r ${./example}/* ~/gits/nixos/ + ''; + }; }; } diff --git a/home/default.nix b/home/default.nix index ee4f804..afc0ab3 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,13 +1,11 @@ { mkDashDefault, - additionalHomeConfig, - additionalHomeMods, - additionalInputs, dashNixAdditionalProps, config, homeMods, inputs, lib, + additionalHomeConfig, mod, pkgs, root, @@ -42,7 +40,6 @@ inherit inputs root - additionalInputs alternativePkgs system stable @@ -62,9 +59,8 @@ ../lib/foxwrappers.nix ] ++ homeMods - ++ additionalHomeMods - ++ lib.optional (builtins.pathExists mod) mod - ++ lib.optional (builtins.pathExists additionalHomeConfig) additionalHomeConfig; + ++ lib.optional (builtins.pathExists additionalHomeConfig) additionalHomeConfig + ++ lib.optional (builtins.pathExists mod) mod; }; }; } diff --git a/lib/default.nix b/lib/default.nix index 30d34ec..d8a7402 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,13 +1,188 @@ { inputs, - lib, unstable, self, - stable, system, + permittedPackages, dashNixAdditionalProps ? {}, ... -}: { +}: let + defaultConfig = { + config = { + allowUnfree = true; + permittedInsecurePackages = permittedPackages; + }; + overlays = [ + inputs.cachy.overlays.default + inputs.nur.overlays.default + ]; + inherit system; + }; + mkPkgs = { + pkgs, + config, + }: let + overlays = + if (config ? overlays) + then config.overlays + else []; + comnbinedConfig = config // {overlays = overlays ++ defaultConfig.overlays;}; + in + import pkgs comnbinedConfig; +in rec { + mkNixos = { + root, + inputLib, + lib, + stablePkgs, + unstablePkgs, + stableMods, + unstableMods, + overridePkgs, + ... + }: + builtins.listToAttrs ( + map + (name: { + inherit name; + value = let + mod = root + /hosts/${name}/configuration.nix; + additionalNixosConfig = root + /hosts/${name}/hardware.nix; + additionalHomeConfig = root + /hosts/${name}/home.nix; + args = { + inherit + self + inputs + mod + additionalHomeConfig + system + root + dashNixAdditionalProps + lib + ; + stable = stablePkgs; + unstable = unstablePkgs; + pkgs = lib.mkForce ( + if overridePkgs + then stablePkgs + else unstablePkgs + ); + alternativePkgs = + if overridePkgs + then unstablePkgs + else stablePkgs; + hostName = name; + homeMods = + if overridePkgs + then unstableMods.home + else stableMods.home; + mkDashDefault = import ./override.nix {inherit lib;}; + }; + nixosMods = + if overridePkgs + then unstableMods.nixos + else stableMods.nixos; + in + inputLib.nixosSystem { + modules = + [ + {_module.args = args;} + mod + ] + ++ nixosMods + ++ lib.optional (builtins.pathExists additionalNixosConfig) additionalNixosConfig + ++ lib.optional (builtins.pathExists mod) mod; + }; + }) + ( + lib.lists.remove "" ( + lib.attrsets.mapAttrsToList (name: fType: + if fType == "directory" + then name + else "") ( + builtins.readDir (root + /hosts) + ) + ) + ) + ); + + mkHome = { + root, + lib, + stablePkgs, + unstablePkgs, + stableMods, + unstableMods, + overridePkgs, + ... + }: + builtins.listToAttrs ( + map + (name: { + inherit name; + value = let + mod = root + /homes/${name}/configuration.nix; + additionalHomeConfig = root + /homes/${name}/home.nix; + args = { + inherit + self + inputs + mod + additionalHomeConfig + system + root + dashNixAdditionalProps + lib + ; + stable = stablePkgs; + unstable = unstablePkgs; + pkgs = lib.mkForce ( + if overridePkgs + then stablePkgs + else unstablePkgs + ); + alternativePkgs = + if overridePkgs + then unstablePkgs + else stablePkgs; + userName = name; + mkDashDefault = import ./override.nix {inherit lib;}; + }; + homeMods = + if overridePkgs + then unstableMods.home + else stableMods.home; + in + inputs.home-manager.lib.homeManagerConfiguration + { + inherit (args) pkgs; + modules = + [ + {_module.args = args;} + mod + ] + ++ homeMods + ++ [ + ../home/common.nix + ../home/themes + ../home/sync.nix + ./foxwrappers.nix + ] + ++ lib.optional (builtins.pathExists mod) mod; + }; + }) + ( + lib.lists.remove "" ( + lib.attrsets.mapAttrsToList (name: fType: + if fType == "directory" + then name + else "") ( + builtins.readDir (root + /homes) + ) + ) + ) + ); + /* * # buildSystems @@ -36,107 +211,75 @@ # ); # in - buildSystems = { + buildFunc = func: { root, - additionalMods ? { - nixos = []; - home = []; - }, - mods ? { - nixos = [ - inputs.lanzaboote.nixosModules.lanzaboote - inputs.nixos-wsl.nixosModules.default - inputs.home-manager.nixosModules.home-manager - inputs.stylix.nixosModules.stylix - inputs.disko.nixosModules.disko - inputs.superfreq.nixosModules.default - inputs.sops-nix.nixosModules.sops - ../base - ../home - ../modules - inputs.chaoticNyx.nixosModules.default - ]; - home = [ - inputs.anyrun.homeManagerModules.default - inputs.ironbar.homeManagerModules.default - inputs.oxicalc.homeManagerModules.default - inputs.oxishut.homeManagerModules.default - inputs.oxinoti.homeManagerModules.default - inputs.oxidash.homeManagerModules.default - inputs.oxipaste.homeManagerModules.default - inputs.oxirun.homeManagerModules.default - inputs.hyprdock.homeManagerModules.default - inputs.hyprland.homeManagerModules.default - inputs.reset.homeManagerModules.default - inputs.sops-nix.homeManagerModules.sops - inputs.dashvim.homeManagerModules.dashvim - inputs.chaoticNyx.homeManagerModules.default - ../modules - ]; - }, - additionalInputs ? {}, + unstableBundle ? {}, + stableBundle ? {}, overridePkgs ? false, ... - }: - builtins.listToAttrs ( - map - (name: { - inherit name; - value = let - mod = root + /hosts/${name}/configuration.nix; - additionalNixosConfig = root + /hosts/${name}/hardware.nix; - additionalHomeConfig = root + /hosts/${name}/home.nix; - args = { - inherit - self - inputs - mod - additionalHomeConfig - system - root - stable - unstable - additionalInputs - dashNixAdditionalProps - ; - pkgs = lib.mkForce ( - if overridePkgs - then stable - else unstable - ); - alternativePkgs = - if overridePkgs - then unstable - else stable; - hostName = name; - homeMods = mods.home; - additionalHomeMods = additionalMods.home; - mkDashDefault = import ./override.nix {inherit lib;}; - }; - in - inputs.unstable.lib.nixosSystem { - modules = - [ - {_module.args = args;} - mod - ] - ++ mods.nixos - ++ additionalMods.nixos - ++ inputs.unstable.lib.optional (builtins.pathExists additionalNixosConfig) additionalNixosConfig - ++ inputs.unstable.lib.optional (builtins.pathExists mod) mod; - }; - }) - ( - lib.lists.remove "" ( - lib.attrsets.mapAttrsToList (name: fType: - if fType == "directory" - then name - else "") ( - builtins.readDir (root + /hosts) - ) - ) - ) - ); + }: let + defaultNixosMods = inputs: [ + inputs.lanzaboote.nixosModules.lanzaboote + inputs.nixos-wsl.nixosModules.default + inputs.home-manager.nixosModules.home-manager + inputs.stylix.nixosModules.stylix + inputs.disko.nixosModules.disko + inputs.superfreq.nixosModules.default + inputs.sops-nix.nixosModules.sops + ../base + ../home + ../modules + ]; + + defaultHomeMods = inputs: [ + inputs.anyrun.homeManagerModules.default + inputs.ironbar.homeManagerModules.default + inputs.oxicalc.homeManagerModules.default + inputs.oxishut.homeManagerModules.default + inputs.oxinoti.homeManagerModules.default + inputs.oxidash.homeManagerModules.default + inputs.oxipaste.homeManagerModules.default + inputs.oxirun.homeManagerModules.default + inputs.hyprdock.homeManagerModules.default + inputs.hyprland.homeManagerModules.default + inputs.reset.homeManagerModules.default + inputs.sops-nix.homeManagerModules.sops + inputs.dashvim.homeManagerModules.dashvim + ../modules + ]; + + unstableInput = unstableBundle.pkgs or inputs.unstable; + stableInput = stableBundle.pkgs or inputs.stable; + unstableConfig = unstableBundle.config or defaultConfig; + stableConfig = stableBundle.config or defaultConfig; + unstableInputs = (unstableBundle.inputs or {}) // inputs; + stableInputs = (stableBundle.inputs or {}) // inputs; + unstableMods = { + home = (defaultHomeMods unstableInputs) ++ (unstableBundle.mods.home or []); + nixos = (defaultNixosMods unstableInputs) ++ (unstableBundle.mods.nixos or []); + }; + stableMods = { + home = (defaultHomeMods stableInputs) ++ (stableBundle.mods.home or []); + nixos = (defaultNixosMods stableInputs) ++ (stableBundle.mods.nixos or []); + }; + + unstablePkgs = mkPkgs { + pkgs = unstableInput; + config = unstableConfig; + }; + stablePkgs = mkPkgs { + pkgs = stableInput; + config = stableConfig; + }; + inputLib = unstableInput.lib; + inherit (unstablePkgs) lib; + in + func { + inherit lib inputLib stablePkgs unstablePkgs stableMods unstableMods stableInputs unstableInputs root overridePkgs; + }; + + buildSystems = buildFunc mkNixos; + buildHome = buildFunc mkHome; buildIso = inputs.unstable.lib.nixosSystem { specialArgs = { diff --git a/lib/importPkgs.nix b/lib/importPkgs.nix index 77e1299..cfcd413 100644 --- a/lib/importPkgs.nix +++ b/lib/importPkgs.nix @@ -12,6 +12,6 @@ import pkgs { }; overlays = [ inputs.nur.overlays.default - inputs.chaoticNyx.overlays.cache-friendly + inputs.cachy.overlays.default ]; } diff --git a/lib/wm.nix b/lib/wm.nix index 1352623..416956a 100644 --- a/lib/wm.nix +++ b/lib/wm.nix @@ -1,4 +1,4 @@ -{lib, ...}: let +let browserName = config: if (builtins.isString config.mods.homePackages.browser) then config.mods.homePackages.browser @@ -50,14 +50,11 @@ in { ]; hyprland = [ # window rules - "float,class:^(.*)(OxiCalc)(.*)$" - "float,class:^(.*)(winecfg.exe)(.*)$" - "float,class:^(.*)(copyq)(.*)$" - "center,class:^(.*)(swappy)(.*)$" - "workspace 10 silent,class:^(.*)(steam)(.*)$" - - # Otherwise neovide will ignore tiling - "suppressevent fullscreen maximize,class:^(.*)(neovide)(.*)$" + "match:class OxiCalc, float on" + "match:class winecfg.exe, float on" + "match:class copyq, float on" + "match:class swappy, center on" + "match:class steam, workspace 10 silent" ]; }; @@ -156,7 +153,7 @@ in { (mkSimpleBind ["Mod"] "7" "focusWorkspace" ["7"]) (mkSimpleBind ["Mod"] "8" "focusWorkspace" ["8"]) (mkSimpleBind ["Mod"] "9" "focusWorkspace" ["9"]) - (mkSimpleBind ["Mod"] "0" "focusWorkspace" ["0"]) + (mkSimpleBind ["Mod"] "0" "focusWorkspace" ["10"]) (mkSimpleBind ["Mod" "Shift"] "1" "moveToWorkspace" ["1"]) (mkSimpleBind ["Mod" "Shift"] "2" "moveToWorkspace" ["2"]) (mkSimpleBind ["Mod" "Shift"] "3" "moveToWorkspace" ["3"]) @@ -166,7 +163,7 @@ in { (mkSimpleBind ["Mod" "Shift"] "7" "moveToWorkspace" ["7"]) (mkSimpleBind ["Mod" "Shift"] "8" "moveToWorkspace" ["8"]) (mkSimpleBind ["Mod" "Shift"] "9" "moveToWorkspace" ["9"]) - (mkSimpleBind ["Mod" "Shift"] "0" "moveToWorkspace" ["0"]) + (mkSimpleBind ["Mod" "Shift"] "0" "moveToWorkspace" ["10"]) (mkSimpleBind ["Mod"] "B" "toggleFullscreen" []) (mkSimpleBind ["Mod"] "V" "toggleFloating" []) (mkSimpleBind ["Mod" "Shift"] "M" "quit" []) @@ -247,8 +244,8 @@ in { else {} ) - (mkBindWithDesc ["Mod"] "S" "spawn-sh" [''grim -g \"$(slurp)\" - | wl-copy''] "Take Screenshot") - (mkBindWithDesc ["Mod" "Shift"] "S" "spawn-sh" [''grim -g \"$(slurp)\" - | satty -f -''] "Take Screenshot and edit") + (mkBindWithDesc ["Mod"] "S" "spawn-sh" [''grim -g "$(slurp)" - | wl-copy''] "Take Screenshot") + (mkBindWithDesc ["Mod" "Shift"] "S" "spawn-sh" [''grim -g "$(slurp)" - | satty -f -''] "Take Screenshot and edit") ( if config.mods.scripts.audioControl @@ -366,7 +363,7 @@ in { (mkSimpleCustomBind ["Mod" "Ctrl"] "7" "move-column-to-workspace" null ["7"]) (mkSimpleCustomBind ["Mod" "Ctrl"] "8" "move-column-to-workspace" null ["8"]) (mkSimpleCustomBind ["Mod" "Ctrl"] "9" "move-column-to-workspace" null ["9"]) - (mkSimpleCustomBind ["Mod" "Ctrl"] "0" "move-column-to-workspace" null ["0"]) + (mkSimpleCustomBind ["Mod" "Ctrl"] "0" "move-column-to-workspace" null ["10"]) (mkSimpleCustomBind ["Mod" "Shift"] "J" "focus-monitor-left" null []) (mkSimpleCustomBind ["Mod" "Shift"] "semicolon" "focus-monitor-right" null []) (mkSimpleCustomBind ["Mod" "Ctrl"] "J" "move-column-to-monitor-left" null []) @@ -425,7 +422,7 @@ in { (mkSimpleCustomBind ["Mod" "SHIFT" "ALT"] "7" null "movetoworkspacesilent" ["7"]) (mkSimpleCustomBind ["Mod" "SHIFT" "ALT"] "8" null "movetoworkspacesilent" ["8"]) (mkSimpleCustomBind ["Mod" "SHIFT" "ALT"] "9" null "movetoworkspacesilent" ["9"]) - (mkSimpleCustomBind ["Mod" "SHIFT" "ALT"] "0" null "movetoworkspacesilent" ["0"]) + (mkSimpleCustomBind ["Mod" "SHIFT" "ALT"] "0" null "movetoworkspacesilent" ["10"]) (mkRepeatCustomBind ["Mod"] "U" null "resizeactive" ["-20" "0"]) (mkRepeatCustomBind ["Mod"] "P" null "resizeactive" ["20" "0"]) (mkRepeatCustomBind ["Mod"] "O" null "resizeactive" ["0" "-20"]) diff --git a/modules/programs/basePackages.nix b/modules/programs/basePackages.nix index fa10da8..1d1b2b9 100644 --- a/modules/programs/basePackages.nix +++ b/modules/programs/basePackages.nix @@ -87,7 +87,6 @@ if config.mods.basePackages.enable then { - preload.enable = mkDashDefault true; upower.enable = mkDashDefault true; dbus = { enable = mkDashDefault true; diff --git a/modules/programs/browser/zen.nix b/modules/programs/browser/zen.nix index d3a9b0a..db32900 100644 --- a/modules/programs/browser/zen.nix +++ b/modules/programs/browser/zen.nix @@ -121,7 +121,7 @@ in { }; }; config = lib.mkIf (config.mods.browser.zen.enable || config.mods.homePackages.browser == "zen") ( - lib.optionalAttrs (options ? home.packages) { + (lib.optionalAttrs (options ? home.packages) { programs.zen-browser = { enable = true; package = @@ -149,7 +149,9 @@ in { }; profiles = builtins.listToAttrs config.mods.browser.zen.profiles; }; + }) + // (lib.optionalAttrs (options ? stylix.targets.zen-browser) { stylix.targets.zen-browser.profileNames = lib.map (profile: profile.name) config.mods.browser.zen.profiles; - } + }) ); } diff --git a/modules/programs/clam.nix b/modules/programs/clam.nix new file mode 100644 index 0000000..e212529 --- /dev/null +++ b/modules/programs/clam.nix @@ -0,0 +1,60 @@ +{ + lib, + config, + options, + pkgs, + ... +}: { + options.mods.clam = { + enable = lib.mkOption { + default = true; + example = false; + type = lib.types.bool; + description = "Enables the clamav program and its daemon"; + }; + scanner = { + enable = lib.mkOption { + default = false; + example = true; + type = lib.types.bool; + description = "Enables the clamav scanner"; + }; + interval = lib.mkOption { + type = lib.types.str; + default = "*-*-* 04:00:00"; + description = '' + How often clamdscan is invoked. + By default this runs using 10 cores at most, be sure to run it at a time of low traffic. + ''; + }; + scanDirectories = lib.mkOption { + type = with lib.types; listOf str; + default = [ + "/home" + "/var/lib" + "/tmp" + "/etc" + "/var/tmp" + ]; + description = ''List of directories to scan''; + }; + }; + }; + config = lib.mkIf config.mods.clam.enable ( + lib.optionalAttrs (options ? services.clamav) { + services.clamav = { + daemon.enable = true; + updater.enable = true; + scanner = { + inherit (config.mods.clam.scanner) enable; + inherit (config.mods.clam.scanner) interval; + inherit (config.mods.clam.scanner) scanDirectories; + }; + }; + environment.systemPackages = [ + pkgs.clamav + ]; + } + // lib.optionalAttrs (options ? home.packages) {home.packages = with pkgs; [clamtk];} + ); +} diff --git a/modules/programs/default.nix b/modules/programs/default.nix index 1c0baa5..08a4a2d 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -1,11 +1,11 @@ { imports = [ - ./niri.nix ./acpid.nix ./anyrun.nix ./basePackages.nix ./bluetooth.nix ./browser + ./clam.nix ./coding.nix ./containers.nix ./drives.nix @@ -31,6 +31,7 @@ ./mime.nix ./ncspot.nix ./nextcloud.nix + ./niri.nix ./onedrive.nix ./oxi ./piper.nix @@ -47,9 +48,9 @@ ./sway.nix ./teams.nix ./virtmanager.nix + ./wm.nix ./xkb.nix ./xone.nix - ./wm.nix ./yazi ]; } diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index f063f35..1d8c8c8 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -70,7 +70,7 @@ in { abbr --add cat 'bat' abbr --add find 'fd' abbr --add rm 'rip' - abbr --add cp 'fcp' + abbr --add cp 'cpz' abbr --add cd 'z' abbr --add y 'yazi' diff --git a/modules/programs/gaming.nix b/modules/programs/gaming.nix index 3483171..6c3eb0a 100644 --- a/modules/programs/gaming.nix +++ b/modules/programs/gaming.nix @@ -19,7 +19,8 @@ gamescope gamemode steam - lutris + # TODO broken + # lutris wineWowPackages.stable adwsteamgtk heroic @@ -33,10 +34,14 @@ description = "Install gaming related packages"; }; kernel = lib.mkOption { - default = true; - example = false; + default = false; + example = true; type = lib.types.bool; - description = "Whether to use the CachyOS kernel"; + description = '' + Whether to use the CachyOS kernel. + WARNING: This is a manual compiled kernel! + (Please also ensure you use your own input hash for the source as the compilation can often fail due to temporary broken changes.) + ''; }; steam = lib.mkOption { default = true; @@ -74,18 +79,50 @@ type = lib.types.int; description = "Your gpu device.(Physical id of lshw)"; }; + scheduler = lib.mkOption { + default = "scx_rustland"; + example = "scx_rusty"; + type = with lib.types; + nullOr (enum [ + "scx_bpfland" + "scx_chaos" + "scx_cosmos" + "scx_central" + "scx_flash" + "scx_flatcg" + "scx_lavd" + "scx_layered" + "scx_mitosis" + "scx_nest" + "scx_p2dq" + "scx_pair" + "scx_prev" + "scx_qmap" + "scx_rlfifo" + "scx_rustland" + "scx_rusty" + "scx_sdt" + "scx_simple" + "scx_tickless" + "scx_userland" + "scx_wd40" + ]); + description = "Scheduler to use, null disables this"; + }; }; config = lib.mkIf config.mods.gaming.enable ( lib.optionalAttrs (options ? environment.systemPackages) { environment.systemPackages = config.mods.gaming.tools; - boot.kernelPackages = lib.mkForce pkgs.linuxPackages_cachyos; - services.scx.enable = true; + boot.kernelPackages = lib.mkForce pkgs.cachyosKernels.linuxPackages-cachyos-latest; + services.scx = lib.mkIf (config.mods.gaming.scheduler != null) { + enable = true; + inherit (config.mods.gaming) scheduler; + }; programs = { steam.enable = mkDashDefault config.mods.gaming.steam; gamemode.enable = true; gamemode = { - enableRenice = mkDashDefault true; settings = { general = { desiredgov = mkDashDefault "performance"; diff --git a/modules/programs/git.nix b/modules/programs/git.nix index bfcb334..57c1623 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -50,9 +50,14 @@ config = lib.optionalAttrs (options ? programs.git && options ? home.file) { programs.git = { enable = true; - userName = config.mods.git.username; - userEmail = config.mods.git.email; - extraConfig = config.mods.git.additionalConfig; + settings = + { + user = { + name = config.mods.git.username; + inherit (config.mods.git) email; + }; + } + // config.mods.git.additionalConfig; }; home.file.".ssh/config".text = config.mods.git.sshConfig; }; diff --git a/modules/programs/gpu.nix b/modules/programs/gpu.nix index 8fd8959..023b462 100644 --- a/modules/programs/gpu.nix +++ b/modules/programs/gpu.nix @@ -87,12 +87,11 @@ pkgs.intel-media-driver) (lib.mkIf config.mods.gpu.vapi.enable pkgs.libvdpau-va-gl) (lib.mkIf config.mods.gpu.vapi.enable pkgs.libva) - (lib.mkIf config.mods.gpu.vapi.enable pkgs.vaapiVdpau) + (lib.mkIf config.mods.gpu.vapi.enable pkgs.libva-vdpau-driver) (lib.mkIf (config.mods.gpu.intelgpu.enable || config.mods.gpu.amdgpu.enable) pkgs.mesa) ]; rocmPackages = [ - # TODO broken - #pkgs.rocmPackages.clr.icd + pkgs.rocmPackages.clr.icd pkgs.mesa pkgs.mesa.opencl pkgs.vulkan-loader diff --git a/modules/programs/greetd.nix b/modules/programs/greetd.nix index 2c5f87f..fe3e455 100644 --- a/modules/programs/greetd.nix +++ b/modules/programs/greetd.nix @@ -5,6 +5,7 @@ inputs, pkgs, options, + system, ... }: { options.mods = { @@ -43,11 +44,11 @@ }; greeterCommand = lib.mkOption { default = "${ - lib.getExe pkgs.hyprland + lib.getExe inputs.hyprland.packages.${system}.hyprland } --config /etc/greetd/hyprgreet.conf"; example = "${ lib.getExe pkgs.cage - } -s -- ${lib.getExe pkgs.greetd.regreet}"; + } -s -- ${lib.getExe pkgs.regreet}"; type = lib.types.str; description = "The compositor/greeter command to run"; }; @@ -130,6 +131,8 @@ misc { disable_splash_rendering = false disable_hyprland_logo = true + disable_xdg_env_checks = true + disable_scale_notification = true } env=STATE_DIR,var/cache/regreet diff --git a/modules/programs/homePackages.nix b/modules/programs/homePackages.nix index eabd176..6a995f0 100644 --- a/modules/programs/homePackages.nix +++ b/modules/programs/homePackages.nix @@ -102,11 +102,11 @@ (lib.mkIf config.mods.homePackages.orcaSlicer orca-slicer) (lib.mkIf config.mods.homePackages.vesktop vesktop) (lib.mkIf config.mods.homePackages.nextcloudClient nextcloud-client) - (lib.mkIf (!isNull config.mods.homePackages.matrixClient) config.mods.homePackages.matrixClient) - (lib.mkIf (!isNull config.mods.homePackages.mailClient) config.mods.homePackages.mailClient) + (lib.mkIf (config.mods.homePackages.matrixClient != null) config.mods.homePackages.matrixClient) + (lib.mkIf (config.mods.homePackages.mailClient != null) config.mods.homePackages.mailClient) (lib.mkIf ( # NOTE: This should be package, but nix doesn't have that.... - builtins.isAttrs config.mods.homePackages.browser && !isNull config.mods.homePackages.browser + builtins.isAttrs config.mods.homePackages.browser && config.mods.homePackages.browser != null ) config.mods.homePackages.browser) adw-gtk3 @@ -128,11 +128,11 @@ nh nix-index playerctl - poppler_utils + poppler-utils pulseaudio libsForQt5.qt5ct - qt6ct - fcp + qt6Packages.qt6ct + fuc ripgrep rm-improved system-config-printer diff --git a/modules/programs/hypr/hyprland.nix b/modules/programs/hypr/hyprland.nix index f6ee377..442b964 100644 --- a/modules/programs/hypr/hyprland.nix +++ b/modules/programs/hypr/hyprland.nix @@ -6,7 +6,7 @@ pkgs, ... }: let - defaultWmConf = import ../../../lib/wm.nix {inherit lib;}; + defaultWmConf = import ../../../lib/wm.nix; in { options.mods.hypr.hyprland = { enable = lib.mkOption { @@ -137,7 +137,7 @@ in { if args != [] then (lib.strings.concatStringsSep " " args) else ""; - shouldRepeat = bind: bind ? meta && bind.meta ? hyprland && bind.meta.hyprland ? repeat && bind.meta.hyprland.repeat; + shouldRepeat = bind: bind ? meta && bind.meta ? hyprland && bind.meta.hyprland ? repeat && bind.meta.hyprland.repeat == true; defaultBinds = cfg: if cfg.mods.wm.useDefaultBinds @@ -148,7 +148,7 @@ in { binds = cfg.mods.wm.binds ++ defaultBinds cfg; in binds - |> builtins.filter (bind: bind ? command && shouldRepeat bind && !hasInvalidCustomCommand bind) + |> builtins.filter (bind: bind ? command && shouldRepeat bind && !(hasInvalidCustomCommand bind)) |> builtins.map ( bind: "${mkMods bind},${bind.key},${mkCommand bind}" ); @@ -156,7 +156,7 @@ in { binds = cfg.mods.wm.binds ++ defaultBinds cfg; in binds - |> builtins.filter (bind: bind ? command && !(shouldRepeat bind) && !hasInvalidCustomCommand bind) + |> builtins.filter (bind: bind ? command && !(shouldRepeat bind) && !(hasInvalidCustomCommand bind)) |> builtins.map ( bind: "${mkMods bind},${bind.key},${mkCommand bind}" ); @@ -241,7 +241,6 @@ in { defaultWindowRules; in { enable = true; - package = mkDashDefault pkgs.hyprland; plugins = [ (lib.mkIf config.mods.hypr.hyprland.hyprspaceEnable pkgs.hyprlandPlugins.hyprspace) @@ -311,6 +310,8 @@ in { enable_swallow = mkDashDefault true; disable_splash_rendering = mkDashDefault true; disable_hyprland_logo = mkDashDefault true; + disable_xdg_env_checks = mkDashDefault true; + disable_scale_notification = mkDashDefault true; swallow_regex = mkDashDefault "^(.*)(kitty)(.*)$"; initial_workspace_tracking = mkDashDefault 1; # just doesn't work @@ -335,16 +336,16 @@ in { layerrule = [ # layer rules # mainly to disable animations within slurp and grim - "noanim, selection" + "match:namespace selection, no_anim on" ]; - workspace = mkDashDefault (mkWorkspace config.mods.wm.workspaces); - monitor = mkDashDefault (mkMonitors config.mods.wm.monitors); - env = mkDashDefault (mkEnv config); - bind = mkDashDefault (mkBinds config); - binde = mkDashDefault (mkEBinds config); - windowrule = mkDashDefault (mkWindowRule config); - exec-once = mkDashDefault (mkAutoStart config); + workspace = mkWorkspace config.mods.wm.workspaces; + monitor = mkMonitors config.mods.wm.monitors; + env = mkEnv config; + bind = mkBinds config; + binde = mkEBinds config; + windowrule = mkWindowRule config; + exec-once = mkAutoStart config; plugin = config.mods.hypr.hyprland.pluginConfig; } config.mods.hypr.hyprland.customConfig diff --git a/modules/programs/ironbar.nix b/modules/programs/ironbar.nix index 5757347..b955d51 100644 --- a/modules/programs/ironbar.nix +++ b/modules/programs/ironbar.nix @@ -4,6 +4,7 @@ pkgs, inputs, options, + mkDashDefault, ... }: let inherit (config.conf) username; @@ -13,9 +14,14 @@ end = [ (lib.mkIf useBatteryModule { - type = "upower"; + type = "battery"; class = "battery"; icon_size = 0; + format = "{percentage}%"; + thresholds = { + warning = 20; + critical = 5; + }; }) { class = "music"; @@ -258,8 +264,7 @@ in { config = lib.mkIf (config.mods.ironbar.enable || config.mods.hypr.hyprland.useIronbar) ( lib.optionalAttrs (options ? programs.ironbar) { programs.ironbar = { - # TODO broken - # package = mkDashDefault pkgs.ironbar; + package = mkDashDefault pkgs.ironbar; enable = true; style = if config.mods.ironbar.useDefaultCss @@ -430,8 +435,8 @@ in { color: @background; } - /* upower */ - .upower { + /* battery */ + .battery { font-size: 13px; padding: 0px 4px 0px 0px; margin: 2px 0px 2px 0px; @@ -439,21 +444,21 @@ in { color: @primary; } - .upower .icon { + .battery .icon { opacity: 0.0; } - .upower .label { + .battery .label { margin: 2px 0px 0px -8px; color: @primary; } - .upower:hover { + .battery:hover { background-color: @secondary-background; border-radius: 5px; } - .popup-upower { + .popup-battery { background-color: @background; color: @primary; border-radius: 8px; diff --git a/modules/programs/media.nix b/modules/programs/media.nix index f05500d..c37d62b 100644 --- a/modules/programs/media.nix +++ b/modules/programs/media.nix @@ -39,7 +39,7 @@ filePickerPortal = lib.mkOption { default = "Term"; example = "Gnome"; - type = with lib.types; oneOf [(enum ["Gnome" "Kde" "Lxqt" "Gtk" "Term" "Default"]) string]; + type = with lib.types; oneOf [(enum ["Gnome" "Kde" "Lxqt" "Gtk" "Term" "Default"]) str]; description = '' The file picker portal to use (set with shana). Default removes the config, allowing you to set it yourself. @@ -87,14 +87,14 @@ # audio control playerctl # images - imv + eog # videos mpv # pdf zathura evince libreoffice-fresh - onlyoffice-bin + onlyoffice-desktopeditors pdftk pdfpc polylux2pdfpc diff --git a/modules/programs/mime.nix b/modules/programs/mime.nix index 03d04d8..4da7aff 100644 --- a/modules/programs/mime.nix +++ b/modules/programs/mime.nix @@ -85,7 +85,7 @@ in { description = "Applications used for handling browser mime types"; }; imageApplications = lib.mkOption { - default = ["imv"]; + default = ["eog"]; example = []; type = with lib.types; listOf str; description = "Applications used for handling image mime types"; diff --git a/modules/programs/niri.nix b/modules/programs/niri.nix index cf39776..0531829 100644 --- a/modules/programs/niri.nix +++ b/modules/programs/niri.nix @@ -6,7 +6,7 @@ pkgs, ... }: let - defaultWmConf = import ../../lib/wm.nix {inherit lib;}; + defaultWmConf = import ../../lib/wm.nix; in { options.mods.niri = { enable = lib.mkOption { @@ -66,7 +66,10 @@ in { |> lib.strings.concatStringsSep ""; mkNiriArg = args: if args != [] - then "\"${(lib.strings.concatStringsSep " " args)}\"" + then let + concatCommand = lib.strings.concatStringsSep " " args; + validCommand = builtins.replaceStrings [''"''] [''\"''] concatCommand; + in "\"${validCommand}\"" else ""; mkNiriCommand = bind: let args = bind.args or []; @@ -353,6 +356,16 @@ in { } } + ${ + if config.mods.gpu.nvidia.enable + then '' + debug { + wait-for-frame-completion-before-queueing + } + '' + else '''' + } + // Autostart hotkey-overlay { diff --git a/modules/programs/oxi/default.nix b/modules/programs/oxi/default.nix index 942d0d1..83c4f23 100644 --- a/modules/programs/oxi/default.nix +++ b/modules/programs/oxi/default.nix @@ -74,7 +74,7 @@ }; }; } - // lib.optionalAttrs (options ? services.logind) { + // lib.optionalAttrs (options ? services.logind && options ? services.logind.settings) { services.logind.settings.Login.HandleLidSwitchExternalPower = "ignore"; } ); diff --git a/modules/programs/printing.nix b/modules/programs/printing.nix index 848ffef..98bbe4f 100644 --- a/modules/programs/printing.nix +++ b/modules/programs/printing.nix @@ -16,6 +16,10 @@ config = lib.mkIf config.mods.printing.enable ( lib.optionalAttrs (options ? services.printing) { # Enable CUPS to print documents. + environment.systemPackages = with pkgs; [ + simple-scan + ]; + hardware.sane.enable = true; services = { printing = { enable = true; diff --git a/modules/programs/stylix.nix b/modules/programs/stylix.nix index 124cc64..dd11e8c 100644 --- a/modules/programs/stylix.nix +++ b/modules/programs/stylix.nix @@ -91,7 +91,7 @@ in { }; emoji = { - package = pkgs.noto-fonts-emoji; + package = pkgs.noto-fonts-color-emoji; name = "Noto Color Emoji"; }; }; diff --git a/modules/programs/virtmanager.nix b/modules/programs/virtmanager.nix index bf81b93..de38848 100644 --- a/modules/programs/virtmanager.nix +++ b/modules/programs/virtmanager.nix @@ -44,8 +44,6 @@ in { qemu = { package = mkDashDefault pkgs.qemu_kvm; swtpm.enable = mkDashDefault true; - ovmf.enable = mkDashDefault true; - ovmf.packages = [pkgs.OVMFFull.fd]; }; }; spiceUSBRedirection.enable = mkDashDefault true; diff --git a/modules/programs/wm.nix b/modules/programs/wm.nix index 2dd6bba..0f794d3 100644 --- a/modules/programs/wm.nix +++ b/modules/programs/wm.nix @@ -319,7 +319,7 @@ in { }; windowRules = lib.mkOption { - default = []; + default = {}; example = { niri = [ '' diff --git a/modules/programs/yazi/yazi.nix b/modules/programs/yazi/yazi.nix index bed1c03..22e3169 100644 --- a/modules/programs/yazi/yazi.nix +++ b/modules/programs/yazi/yazi.nix @@ -31,7 +31,7 @@ ]; image = [ { - run = ''imv "$@"''; + run = ''eog "$@"''; orphan = true; display_name = "Open"; } @@ -102,6 +102,11 @@ }; keymap = { mgr.keymap = [ + { + on = ""; + run = "backspace"; + desc = "Delete the character before the cursor"; + } { on = [""]; run = "escape"; @@ -763,6 +768,11 @@ ]; input.keymap = [ + { + on = ""; + run = "backspace"; + desc = "Delete the character before the cursor"; + } { on = [""]; run = "close";