refactor(stasis): take the package from nixpkgs
nixpkgs carries stasis 1.5.1, so the pinned input and pkgs/stasis.nix go. It ships no unit and has no NixOS module, so modules/services.nix keeps declaring one; its actions run as `sh -lc` and it spawns niri and pactl directly, hence the unit path. stasis prefers a user config over /etc and generates its own when none exists, so moonarch's is seeded into the home directory instead of only reaching /etc.
This commit is contained in:
1 parent
72af3e0cfc
commit
b1ed5d087b
6 files changed
+23
-70
No files matched your search
@@ -4,7 +4,7 @@ NixOS configuration for a scrollable-tiling Wayland desktop: niri as the
|
||||
compositor, Quickshell as the bar and launcher, regreet as the login greeter,
|
||||
swaylock as the screen locker, Catppuccin Mocha throughout.
|
||||
|
||||
Ships Nix packages for the components that are not in nixpkgs — stasis,
|
||||
Ships Nix packages for the components that are not in nixpkgs —
|
||||
sweet-cursors, the moonarch helper scripts — and NixOS modules that assemble them
|
||||
into a working session. Greeter, locker and power menu are no longer own programs:
|
||||
`regreet` and `swaylock` come from nixpkgs, the power menu is a Quickshell popout
|
||||
@@ -19,7 +19,6 @@ files therefore stays valid on both NixOS and Arch.
|
||||
```
|
||||
flake.nix Inputs and outputs
|
||||
pkgs/ Build recipes
|
||||
stasis.nix idle manager
|
||||
sweet-cursors.nix cursor theme
|
||||
moonarch-scripts.nix battery and camera helpers
|
||||
modules/
|
||||
@@ -43,7 +42,7 @@ alongside the six above and hands them the packages and the config source.
|
||||
Build a single package:
|
||||
|
||||
```bash
|
||||
nix build .#stasis
|
||||
nix build .#sweet-cursors
|
||||
```
|
||||
|
||||
Build a whole system without activating it, which is also how a host is checked
|
||||
@@ -236,12 +235,11 @@ nixos-rebuild switch --rollback` from a system that still comes up.
|
||||
|
||||
## Version bumps
|
||||
|
||||
`stasis` is pinned to a release tag. After a new upstream release:
|
||||
|
||||
```bash
|
||||
# adjust the tag in flake.nix, then
|
||||
nix flake update stasis
|
||||
```
|
||||
`stasis` comes from nixpkgs and needs no pin of its own. It ships no unit, so
|
||||
`modules/services.nix` declares one, and it discards any config missing a knob
|
||||
its own template carries — after a stasis release, check that
|
||||
`defaults/xdg/stasis/stasis.rune` in moonarch still holds every knob the new
|
||||
template does, or the timeouts there stop taking effect.
|
||||
|
||||
`moonarch` tracks `main`, so its config changes arrive with
|
||||
`nix flake update moonarch`.
|
||||
|
||||
Generated
-18
@@ -90,27 +90,9 @@
|
||||
"moonarch": "moonarch",
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"stasis": "stasis",
|
||||
"sweet-cursors": "sweet-cursors"
|
||||
}
|
||||
},
|
||||
"stasis": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1785456405,
|
||||
"narHash": "sha256-w+TfwtoEwjVLZu/g9+kpwpIMZo+PZFg77ryd7DIk3Uk=",
|
||||
"owner": "saltnpepper97",
|
||||
"repo": "stasis",
|
||||
"rev": "4cc9ba55858039c41b21c05c2f037b2010fb62c8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "saltnpepper97",
|
||||
"ref": "v1.4.1",
|
||||
"repo": "stasis",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"sweet-cursors": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
||||
@@ -24,11 +24,6 @@
|
||||
url = "git+https://gitea.moonarch.de/nevaforget/Sweet-cursors.git";
|
||||
flake = false;
|
||||
};
|
||||
# Not packaged in nixpkgs.
|
||||
stasis = {
|
||||
url = "github:saltnpepper97/stasis/v1.4.1";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, ... }@inputs:
|
||||
@@ -42,11 +37,6 @@
|
||||
version = "0-unstable";
|
||||
};
|
||||
|
||||
stasis = pkgs.callPackage ./pkgs/stasis.nix {
|
||||
src = inputs.stasis;
|
||||
version = "1.4.1";
|
||||
};
|
||||
|
||||
moonarch-scripts = pkgs.callPackage ./pkgs/moonarch-scripts.nix {
|
||||
src = inputs.moonarch;
|
||||
};
|
||||
|
||||
+8
-1
@@ -260,7 +260,6 @@ in
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Own programs
|
||||
moonarchPkgs.sweet-cursors
|
||||
moonarchPkgs.stasis
|
||||
moonarchPkgs.moonarch-scripts
|
||||
|
||||
# Browser. Arch runs waterfox-bin, which nixpkgs does not carry; see
|
||||
@@ -349,8 +348,13 @@ in
|
||||
polkit_gnome
|
||||
wdisplays
|
||||
wl-color-picker
|
||||
|
||||
stasis
|
||||
claude-code
|
||||
];
|
||||
|
||||
security.pam.services.swaylock = {};
|
||||
|
||||
# Polkit agent for privilege prompts inside the session.
|
||||
security.polkit.enable = true;
|
||||
|
||||
@@ -367,6 +371,9 @@ in
|
||||
# edits survive. This is what post-install.sh does imperatively on Arch.
|
||||
systemd.user.tmpfiles.rules = [
|
||||
"C %h/.config/waypaper/config.ini 0644 - - - ${waypaperConfig}"
|
||||
# stasis prefers the user config over /etc and generates its own if none
|
||||
# exists, so the moonarch config has to be in place before it starts.
|
||||
"C %h/.config/stasis/stasis.rune 0644 - - - ${xdg}/stasis/stasis.rune"
|
||||
"C %h/.config/swaylock/config 0644 - - - ${swaylockConfig}"
|
||||
"C %h/.zshrc 0644 - - - ${userZshrc}"
|
||||
];
|
||||
|
||||
@@ -96,17 +96,21 @@
|
||||
};
|
||||
};
|
||||
|
||||
# Upstream ships a unit in the Arch package but not in the tarball, so it is
|
||||
# declared here. Mirrors /usr/lib/systemd/user/stasis.service.
|
||||
# nixpkgs ships the package but no module, and the package carries no unit of
|
||||
# its own, so it is declared here. Mirrors /usr/lib/systemd/user/stasis.service.
|
||||
systemd.user.services.stasis = {
|
||||
description = "Stasis Wayland Idle Manager";
|
||||
partOf = [ "graphical-session.target" ];
|
||||
after = [ "graphical-session.target" ];
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
# stasis runs its actions as `sh -lc <command>` and spawns niri and pactl
|
||||
# directly, all resolved against this PATH. pulseaudio is here for pactl
|
||||
# alone; it stays off systemPackages, see modules/desktop.nix.
|
||||
path = with pkgs; [ bash swaylock brightnessctl niri pulseaudio ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${lib.getExe moonarchPkgs.stasis}";
|
||||
ExecReload = "${lib.getExe moonarchPkgs.stasis} reload";
|
||||
ExecStart = "${lib.getExe pkgs.stasis}";
|
||||
ExecReload = "${lib.getExe pkgs.stasis} reload";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 2;
|
||||
};
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
# ABOUTME: Nix build recipe for stasis, the Wayland idle manager.
|
||||
# ABOUTME: Not in nixpkgs; upstream is saltnpepper97/stasis on GitHub.
|
||||
|
||||
{ lib
|
||||
, rustPlatform
|
||||
, pkg-config
|
||||
, wayland
|
||||
, src
|
||||
, version
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "stasis";
|
||||
inherit version src;
|
||||
|
||||
cargoLock.lockFile = "${src}/Cargo.lock";
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ wayland ];
|
||||
|
||||
meta = {
|
||||
description = "Wayland idle manager with sequential, configurable timeouts";
|
||||
homepage = "https://github.com/saltnpepper97/stasis";
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = "stasis";
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user