add overlays (and make them work), update flake

This commit is contained in:
Grimmauld 2024-05-05 13:14:44 +02:00
parent 4dfef18b95
commit 9ce574a6e0
Signed by: Grimmauld
GPG key ID: C2946668769F91FB
13 changed files with 69 additions and 51 deletions

View file

@ -27,7 +27,7 @@ in
start = "${lib.getExe pkgs.libnotify} 'GameMode started'"; start = "${lib.getExe pkgs.libnotify} 'GameMode started'";
end = "${lib.getExe pkgs.libnotify} 'GameMode ended'"; end = "${lib.getExe pkgs.libnotify} 'GameMode ended'";
}; };
}; };
}; };
services.udev.packages = [ pkgs.wooting-udev-rules ]; services.udev.packages = [ pkgs.wooting-udev-rules ];
@ -39,7 +39,7 @@ in
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
heroic heroic
prismlauncher prismlauncher
mangohud mangohud
the-powder-toy the-powder-toy
(pkgs.symlinkJoin { (pkgs.symlinkJoin {
name = "osu"; name = "osu";

View file

@ -65,7 +65,7 @@ in
core.autocrlf = "input"; core.autocrlf = "input";
commit.gpgsign = true; commit.gpgsign = true;
pull.rebase = true; pull.rebase = true;
alias.pfusch= "push --force-with-lease"; alias.pfusch = "push --force-with-lease";
}; };
}; };

View file

@ -6,13 +6,16 @@ in
config = with cfg; lib.mkIf (enable && tooling.enable) { config = with cfg; lib.mkIf (enable && tooling.enable) {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
python3 python3
pypy3
] ++ lib.optionals cfg.graphical [ ] ++ lib.optionals cfg.graphical [
jetbrains.pycharm-community jetbrains.pycharm-community
]; ];
programs.xonsh = { programs.xonsh = {
enable = true; enable = true;
config = ''
aliases[":q"] = "exit"
aliases["ls"] = "eza"
'';
package = pkgs.xonsh.override { package = pkgs.xonsh.override {
extraPackages = ps: with ps; [ extraPackages = ps: with ps; [
requests requests

View file

@ -36,7 +36,7 @@ in
{ {
config = with cfg; lib.mkIf (enable && portals && graphical) { config = with cfg; lib.mkIf (enable && portals && graphical) {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
(callPackage ../../custom/deskwhich/package.nix { }) deskwhich
zathura zathura
alacritty alacritty

View file

@ -285,11 +285,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1712014858, "lastModified": 1714641030,
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", "narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", "rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -504,11 +504,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1714303849, "lastModified": 1714872073,
"narHash": "sha256-o/IgiwA0ZS/nMh5YB0bt+ae3Lt+tlbQouY/xL7tB5h0=", "narHash": "sha256-Gybo6MqJ2tva9vMaSxOgie8uVObiP0LxD2FMokiR0X4=",
"owner": "fufexan", "owner": "fufexan",
"repo": "nix-gaming", "repo": "nix-gaming",
"rev": "dbb96ae98e723128cf5a612480ba6187113f5e49", "rev": "b85b9c3afa1bfee0150580eb76c52e572a85a6a9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -563,11 +563,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1714635257, "lastModified": 1714763106,
"narHash": "sha256-4cPymbty65RvF1DWQfc+Bc8B233A1BWxJnNULJKQ1EY=", "narHash": "sha256-DrDHo74uTycfpAF+/qxZAMlP/Cpe04BVioJb6fdI0YY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "63c3a29ca82437c87573e4c6919b09a24ea61b0f", "rev": "e9be42459999a253a9f92559b1f5b72e1b44c13d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -579,20 +579,14 @@
}, },
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": { "locked": {
"dir": "lib", "lastModified": 1714640452,
"lastModified": 1711703276, "narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=",
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", "type": "tarball",
"owner": "NixOS", "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz"
"repo": "nixpkgs",
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
"type": "github"
}, },
"original": { "original": {
"dir": "lib", "type": "tarball",
"owner": "NixOS", "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz"
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
} }
}, },
"nixpkgs-stable": { "nixpkgs-stable": {

View file

@ -39,11 +39,6 @@
url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/305278.patch"; url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/305278.patch";
hash = "sha256-8RvPI8Id+Ttgv07IMBTAxkSc+K00WhiWgdgrCcULd7o="; hash = "sha256-8RvPI8Id+Ttgv07IMBTAxkSc+K00WhiWgdgrCcULd7o=";
} }
{
# cpupower meta.mainProgram
url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/308476.patch";
hash = "sha256-J/Bvz4RUn9lP7H4s/c6bZEX9dfWsxfG/dpXYF99U3Vs=";
}
{ {
# xdg term # xdg term
url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/303225.patch"; url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/303225.patch";
@ -57,22 +52,29 @@
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
}; };
patched = let unpatched = nixpkgs.legacyPackages.${system}; in overlays = if (builtins.hasAttr "overlays" definitions) then definitions.overlays else [ ];
unpatched.applyPatches { unpatched = nixpkgs.legacyPackages.${system};
name = "nixpkgs-patched"; patched = unpatched.applyPatches {
src = inputs.nixpkgs; name = "nixpkgs-patched";
patches = map unpatched.fetchpatch patches; src = inputs.nixpkgs;
}; patches = map unpatched.fetchpatch patches;
};
nixosSystem = import (patched + "/nixos/lib/eval-config.nix"); nixosSystem = import (patched + "/nixos/lib/eval-config.nix");
in in
nixosSystem ({ nixosSystem ({
inherit system; inherit system;
modules = definitions.modules ++ [
({ config, lib, ... }: {
nixpkgs.overlays = map (f: (final: prev: (import f { inherit final prev lib config; }))) overlays;
})
];
specialArgs = { inherit inputs system stable; }; specialArgs = { inherit inputs system stable; };
} // definitions); } // builtins.removeAttrs definitions [ "overlays" "modules" ]);
in in
{ {
nixosConfigurations = { nixosConfigurations = {
grimmauld-nixos = customNixosSystem "x86_64-linux" { grimmauld-nixos = customNixosSystem "x86_64-linux" {
overlays = import ./overlays;
modules = [ modules = [
agenix.nixosModules.default agenix.nixosModules.default
chaotic.nixosModules.default chaotic.nixosModules.default

View file

@ -35,8 +35,7 @@
obs-studio obs-studio
element-desktop element-desktop
ghidra ghidra
rmview # rmview
arena
]; ];
}; };
} }

5
overlays/default.nix Normal file
View file

@ -0,0 +1,5 @@
[
./deskwhich.nix
./mcontrolcenter.nix
./the-powder-toy.nix
]

3
overlays/deskwhich.nix Normal file
View file

@ -0,0 +1,3 @@
{ final, prev, ... }: {
deskwhich = prev.callPackage ../custom/deskwhich/package.nix { };
}

View file

@ -0,0 +1,8 @@
{ final, prev, ... }: {
mcontrolcenter = prev.callPackage
(prev.fetchurl {
url = "https://raw.githubusercontent.com/NixOS/nixpkgs/2efffaa70e6de4cb34fd694798af5d433250f4e8/pkgs/by-name/mc/mcontrolcenter/package.nix";
hash = "sha256-WnjSrSAurmN6dWOzjjZMXXxh0lUigyRPlXlg3OC0lu8=";
})
{ };
}

View file

@ -0,0 +1,8 @@
{ final, prev, ... }: {
the-powder-toy = prev.callPackage
(prev.fetchurl {
url = "https://raw.githubusercontent.com/NixOS/nixpkgs/9863d8c74a959d73df0c495a55097f804f7b379d/pkgs/by-name/th/the-powder-toy/package.nix";
hash = "sha256-po6jhmdV+HNZBq4/vy6uQsDuW6PyvKcvysWNPZn4K7I=";
})
{ };
}

View file

@ -40,12 +40,7 @@ in
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
(callPackage mcontrolcenter
(fetchurl {
url = "https://raw.githubusercontent.com/NixOS/nixpkgs/2efffaa70e6de4cb34fd694798af5d433250f4e8/pkgs/by-name/mc/mcontrolcenter/package.nix";
hash = "sha256-WnjSrSAurmN6dWOzjjZMXXxh0lUigyRPlXlg3OC0lu8=";
})
{ })
]; ];
grimmShared = { grimmShared = {

View file

@ -1,8 +1,9 @@
{ inputs, system, pkgs, config, lib, ... }: { inputs, system, pkgs, config, lib, ... }:
let let
searchclip = pkgs.writeShellScriptBin "searchclip" '' searchclip = let inherit (lib) getExe; in with pkgs; writeShellScriptBin "searchclip" ''
xdg-open https://www.google.com/search?q=$(wl-paste -p | urlencode) xdg-open https://www.google.com/search?q=$(wl-paste -p | ${getExe urlencode})
browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//") browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//")
sleep .1
swaymsg [app_id="$browser" urgent="newest"] focus swaymsg [app_id="$browser" urgent="newest"] focus
''; '';
in in
@ -156,7 +157,7 @@ in
let let
open = pkgs.writeShellScriptBin "open_or_switch_browser" '' open = pkgs.writeShellScriptBin "open_or_switch_browser" ''
browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//") browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//")
swaymsg [app_id="$browser"] focus || deskwhich $browser | xargs gio launch swaymsg [app_id="$browser"] focus || ${getExe deskwhich} $browser | xargs gio launch
''; '';
in in
"exec ${getExe open}"; "exec ${getExe open}";
@ -167,7 +168,7 @@ in
while IFS= read -r pid; do while IFS= read -r pid; do
swaymsg [pid=$pid] focus && exit 0 swaymsg [pid=$pid] focus && exit 0
done <<< $(pgrep spotify -u "$(whoami)") done <<< $(pgrep spotify -u "$(whoami)")
deskwhich spotify | xargs gio launch ${getExe deskwhich} spotify | xargs gio launch
''; '';
in in
"exec ${getExe open}"; # for some reason tools = audio media on my keyboard?? "exec ${getExe open}"; # for some reason tools = audio media on my keyboard??
@ -175,7 +176,7 @@ in
let let
open = pkgs.writeShellScriptBin "open_or_switch_mail" '' open = pkgs.writeShellScriptBin "open_or_switch_mail" ''
desk=$(xdg-settings get default-url-scheme-handler mailto | sed "s/\.desktop//") desk=$(xdg-settings get default-url-scheme-handler mailto | sed "s/\.desktop//")
swaymsg [app_id="$desk"] focus || deskwhich $desk | xargs gio launch swaymsg [app_id="$desk"] focus || ${getExe deskwhich} $desk | xargs gio launch
''; '';
in in
"exec ${getExe open}"; "exec ${getExe open}";