diff --git a/flake.nix b/flake.nix index 32836b4..0d11e6a 100644 --- a/flake.nix +++ b/flake.nix @@ -103,6 +103,10 @@ }; }) (_: _: {deploy-rs-pkg = null;}) + (_: super: { + tmuxbash = super.callPackage ./pkgs/tmuxbash.nix {}; + nicer = super.callPackage ./pkgs/nicer.nix {}; + }) ]; in { @@ -308,6 +312,7 @@ shared/home ]; extraSpecialArgs = { + inherit self system; stateVersion = "23.05"; username = "motiejus"; email = "motiejusja@wix.com"; diff --git a/modules/profiles/desktop/default.nix b/modules/profiles/desktop/default.nix index 831a54e..b6d2276 100644 --- a/modules/profiles/desktop/default.nix +++ b/modules/profiles/desktop/default.nix @@ -111,6 +111,10 @@ in { }; environment.systemPackages = with pkgs; [ + # packages defined here + nicer + tmuxbash + iw vlc i7z diff --git a/pkgs/nicer.nix b/pkgs/nicer.nix new file mode 100644 index 0000000..d84f2a9 --- /dev/null +++ b/pkgs/nicer.nix @@ -0,0 +1,28 @@ +{ + coreutils, + writeShellApplication, +}: +writeShellApplication { + name = "nicer"; + text = '' + f=$(${coreutils}/bin/mktemp) + trap '${coreutils}/bin/rm -f "$f"' EXIT + ${coreutils}/bin/env > "$f" + systemd-run \ + --user \ + --same-dir \ + --slice nicer \ + --nice=19 \ + --property CPUSchedulingPolicy=idle \ + --property IOSchedulingClass=idle \ + --property IOSchedulingPriority=7 \ + --pty \ + --pipe \ + --wait \ + --collect \ + --quiet \ + --property EnvironmentFile="$f" \ + --service-type=exec \ + -- "$@" + ''; +} diff --git a/pkgs/tmuxbash.nix b/pkgs/tmuxbash.nix new file mode 100644 index 0000000..5e53d64 --- /dev/null +++ b/pkgs/tmuxbash.nix @@ -0,0 +1,13 @@ +{ + tmux, + bash, + writeShellApplication, + ... +}: +writeShellApplication { + name = "tmuxbash"; + text = '' + ${tmux}/bin/tmux + ${bash}/bin/bash + ''; +} diff --git a/shared/home/default.nix b/shared/home/default.nix index e792411..b76be8f 100644 --- a/shared/home/default.nix +++ b/shared/home/default.nix @@ -8,31 +8,6 @@ username ? "motiejus", ... }: let - pkgNicer = pkgs.writeShellApplication { - name = "nicer"; - text = '' - f=$(${pkgs.coreutils}/bin/mktemp) - trap '${pkgs.coreutils}/bin/rm -f "$f"' EXIT - ${pkgs.coreutils}/bin/env > "$f" - systemd-run \ - --user \ - --same-dir \ - --slice nicer \ - --nice=19 \ - --property CPUSchedulingPolicy=idle \ - --property IOSchedulingClass=idle \ - --property IOSchedulingPriority=7 \ - --pty \ - --pipe \ - --wait \ - --collect \ - --quiet \ - --property EnvironmentFile="$f" \ - --service-type=exec \ - -- "$@" - ''; - }; - # from https://github.com/Gerg-L/demoninajar/blob/39964f198dbfa34c21f81c35370fab312b476051/homes/veritas_manjaro/nixGL.nix#L42 mkWrapped = wrap: orig-pkg: execName: pkgs.makeOverridable @@ -79,14 +54,14 @@ in { home.packages = with pkgs; lib.mkMerge [ - [pkgNicer] - (lib.mkIf devTools [ go zig ]) (lib.mkIf hmOnly [ + tmuxbash + nicer ncdu tokei scrcpy