session and seat management daemon
0

Configure Feed

Select the types of activity you want to include in your feed.

add moxseatd to nixos-vm

Oskar Rochowiak (Jun 3, 2026, 11:25 PM +0200) 3eb80320 651e4838

+309 -16
+6 -6
Cargo.lock
··· 208 208 209 209 [[package]] 210 210 name = "hyprwire" 211 - version = "0.4.1" 211 + version = "0.4.2" 212 212 source = "registry+https://github.com/rust-lang/crates.io-index" 213 - checksum = "bfa92531d3a0bf19d8f0e52802873fec014fc95779e084ad657fc05b2b436c14" 213 + checksum = "2d5a4f98af1dc4a105cff6af4746079df5586d45f4b4e77f467f29a94d9e5c34" 214 214 dependencies = [ 215 215 "hyprwire-core", 216 216 "hyprwire-scanner", ··· 220 220 221 221 [[package]] 222 222 name = "hyprwire-core" 223 - version = "0.4.1" 223 + version = "0.4.2" 224 224 source = "registry+https://github.com/rust-lang/crates.io-index" 225 - checksum = "2b1429f79c21435a330318b8e313a4c38450ac09f0dab46a7bc6a0627d85a97b" 225 + checksum = "76c44590144af27e23498a4a8faf318c86ae607e1dc8b2a21f7689794dfcc3bc" 226 226 227 227 [[package]] 228 228 name = "hyprwire-scanner" 229 - version = "0.4.1" 229 + version = "0.4.2" 230 230 source = "registry+https://github.com/rust-lang/crates.io-index" 231 - checksum = "4a9bfc08eb062807627bf023137dcca12a86b88c1e532431384505ce4f27619c" 231 + checksum = "df7955f2db04eb3f3d62341653240e8b9d99f8794eaedbf195d7005b04ab1723" 232 232 dependencies = [ 233 233 "hyprwire-core", 234 234 "prettyplease",
+2 -2
ctl/Cargo.toml
··· 12 12 [dependencies] 13 13 anyhow = "1.0.102" 14 14 clap = { version = "4.6.1", features = ["derive"] } 15 - hyprwire = "0.4.1" 15 + hyprwire = "0.4.2" 16 16 17 17 [build-dependencies] 18 - hyprwire-scanner = "0.4.1" 18 + hyprwire-scanner = "0.4.2"
+2 -2
daemon/Cargo.toml
··· 13 13 anyhow = "1.0.102" 14 14 env_logger = { version = "0.11.10", features = ["kv"] } 15 15 log = { version = "0.4.31", features = ["kv"] } 16 - hyprwire = "0.4.1" 16 + hyprwire = "0.4.2" 17 17 18 18 [build-dependencies] 19 - hyprwire-scanner = "0.4.1" 19 + hyprwire-scanner = "0.4.2"
-1
daemon/src/main.rs
··· 206 206 }; 207 207 208 208 let mut socket = server::Server::bind(&path)?; 209 - 210 209 fs::set_permissions(path, fs::Permissions::from_mode(0o777))?; 211 210 212 211 socket.add_implementation::<moxsession_pam_v1::MoxsessionPamV1Impl, _>(&mut moxsession, 1);
+8
flake.nix
··· 20 20 "aarch64-linux" 21 21 ]; 22 22 23 + sources = import ./npins; 24 + 23 25 pkgsFor = 24 26 system: 25 27 import nixpkgs { ··· 84 86 nixosConfigurations = 85 87 let 86 88 system = "x86_64-linux"; 89 + pkgs = pkgsFor system; 90 + moxseatd = (import sources.moxseatd.outPath { inherit pkgs; }) // { 91 + inherit (sources.moxseatd) outPath; 92 + }; 87 93 in 88 94 { 89 95 nixos-vm = nixpkgs.lib.nixosSystem { 90 96 inherit system; 91 97 specialArgs = { 92 98 inherit (self.packages.${system}) moxsession; 99 + inherit moxseatd; 93 100 }; 94 101 modules = [ 95 102 ./nix/nixos.nix 103 + moxseatd.nixosModules.default 96 104 ./nix/nixos-vm.nix 97 105 ]; 98 106 };
+10 -3
nix/nixos-vm.nix
··· 1 1 { 2 2 modulesPath, 3 3 moxsession, 4 + moxseatd, 4 5 ... 5 6 }: 6 7 { 7 8 imports = [ "${modulesPath}/virtualisation/qemu-vm.nix" ]; 8 9 9 - services.moxsession = { 10 - enable = true; 11 - package = moxsession; 10 + services = { 11 + moxseatd = { 12 + enable = true; 13 + package = moxseatd.packages.default; 14 + }; 15 + moxsession = { 16 + enable = true; 17 + package = moxsession; 18 + }; 12 19 }; 13 20 14 21 virtualisation = {
+260
npins/default.nix
··· 1 + /* 2 + This file is provided under the MIT licence: 3 + 4 + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 + 6 + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 + 8 + THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 + */ 10 + # Generated by npins. Do not modify; will be overwritten regularly 11 + let 12 + # Backwards-compatibly make something that previously didn't take any arguments take some 13 + # The function must return an attrset, and will unfortunately be eagerly evaluated 14 + # Same thing, but it catches eval errors on the default argument so that one may still call it with other arguments 15 + mkFunctor = 16 + fn: 17 + let 18 + e = builtins.tryEval (fn { }); 19 + in 20 + (if e.success then e.value else { error = fn { }; }) // { __functor = _self: fn; }; 21 + 22 + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 23 + range = 24 + first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1); 25 + 26 + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 27 + stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); 28 + 29 + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 30 + stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); 31 + concatStrings = builtins.concatStringsSep ""; 32 + 33 + # If the environment variable NPINS_OVERRIDE_${name} is set, then use 34 + # the path directly as opposed to the fetched source. 35 + # (Taken from Niv for compatibility) 36 + mayOverride = 37 + name: path: 38 + let 39 + envVarName = "NPINS_OVERRIDE_${saneName}"; 40 + saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null then "_" else c) name; 41 + ersatz = builtins.getEnv envVarName; 42 + in 43 + if ersatz == "" then 44 + path 45 + else 46 + # this turns the string into an actual Nix path (for both absolute and 47 + # relative paths) 48 + builtins.trace "Overriding path of \"${name}\" with \"${ersatz}\" due to set \"${envVarName}\"" ( 49 + if builtins.substring 0 1 ersatz == "/" then 50 + /. + ersatz 51 + else 52 + /. + builtins.getEnv "PWD" + "/${ersatz}" 53 + ); 54 + 55 + mkSource = 56 + name: spec: 57 + { 58 + pkgs ? null, 59 + }: 60 + assert spec ? type; 61 + let 62 + # Unify across builtin and pkgs fetchers. 63 + # `fetchGit` requires a wrapper because of slight API differences. 64 + fetchers = 65 + if pkgs == null then 66 + { 67 + inherit (builtins) fetchTarball fetchurl; 68 + # Frustratingly, due to flakes and `fetchTree`, `fetchGit` 69 + # has a different signature than the other builtin 70 + # fetchers 71 + fetchGit = args: (builtins.fetchGit args).outPath; 72 + } 73 + else 74 + { 75 + fetchTarball = 76 + { 77 + url, 78 + sha256, 79 + }: 80 + pkgs.fetchzip { 81 + inherit url sha256; 82 + extension = "tar"; 83 + }; 84 + inherit (pkgs) fetchurl; 85 + fetchGit = 86 + { 87 + url, 88 + submodules, 89 + rev, 90 + name, 91 + narHash, 92 + }: 93 + pkgs.fetchgit { 94 + inherit url rev name; 95 + fetchSubmodules = submodules; 96 + hash = narHash; 97 + }; 98 + }; 99 + 100 + path = 101 + if spec.type == "Git" then 102 + mkGitSource fetchers spec 103 + else if spec.type == "GitRelease" then 104 + mkGitSource fetchers spec 105 + else if spec.type == "PyPi" then 106 + mkPyPiSource fetchers spec 107 + else if spec.type == "Channel" then 108 + mkChannelSource fetchers spec 109 + else if spec.type == "Url" || spec.type == "MutableUrl" then 110 + mkUrlSource fetchers spec 111 + else if spec.type == "Container" then 112 + mkContainerSource pkgs spec 113 + else 114 + builtins.throw "Unknown source type ${spec.type}"; 115 + in 116 + spec // { outPath = mayOverride name path; }; 117 + 118 + mkGitSource = 119 + { 120 + fetchTarball, 121 + fetchGit, 122 + ... 123 + }: 124 + { 125 + repository, 126 + revision, 127 + url ? null, 128 + submodules, 129 + hash, 130 + ... 131 + }: 132 + assert repository ? type; 133 + # At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository 134 + # In the latter case, there we will always be an url to the tarball 135 + if url != null && !submodules then 136 + fetchTarball { 137 + inherit url; 138 + sha256 = hash; 139 + } 140 + else 141 + let 142 + url = 143 + if repository.type == "Git" then 144 + repository.url 145 + else if repository.type == "GitHub" then 146 + "https://github.com/${repository.owner}/${repository.repo}.git" 147 + else if repository.type == "GitLab" then 148 + "${repository.server}/${repository.repo_path}.git" 149 + else if repository.type == "Forgejo" then 150 + "${repository.server}/${repository.owner}/${repository.repo}.git" 151 + else 152 + throw "Unrecognized repository type ${repository.type}"; 153 + urlToName = 154 + url: rev: 155 + let 156 + matched = builtins.match "^.*/([^/]*)(\\.git)?$" url; 157 + 158 + short = builtins.substring 0 7 rev; 159 + 160 + appendShort = if (builtins.match "[a-f0-9]*" rev) != null then "-${short}" else ""; 161 + in 162 + "${if matched == null then "source" else builtins.head matched}${appendShort}"; 163 + name = urlToName url revision; 164 + in 165 + fetchGit { 166 + rev = revision; 167 + narHash = hash; 168 + 169 + inherit name submodules url; 170 + }; 171 + 172 + mkPyPiSource = 173 + { fetchurl, ... }: 174 + { 175 + url, 176 + hash, 177 + ... 178 + }: 179 + fetchurl { 180 + inherit url; 181 + sha256 = hash; 182 + }; 183 + 184 + mkChannelSource = 185 + { fetchTarball, ... }: 186 + { 187 + url, 188 + hash, 189 + ... 190 + }: 191 + fetchTarball { 192 + inherit url; 193 + sha256 = hash; 194 + }; 195 + 196 + mkUrlSource = 197 + { 198 + fetchTarball, 199 + fetchurl, 200 + ... 201 + }: 202 + { 203 + url, 204 + hash, 205 + unpack, 206 + ... 207 + }: 208 + (if unpack then fetchTarball else fetchurl) { 209 + inherit url; 210 + sha256 = hash; 211 + }; 212 + 213 + mkContainerSource = 214 + pkgs: 215 + { 216 + image_name, 217 + image_tag, 218 + image_digest, 219 + hash, 220 + ... 221 + }@args: 222 + if pkgs == null then 223 + builtins.throw "container sources require passing in a Nixpkgs value: https://github.com/andir/npins/blob/master/README.md#using-the-nixpkgs-fetchers" 224 + else 225 + pkgs.dockerTools.pullImage ( 226 + { 227 + imageName = image_name; 228 + imageDigest = image_digest; 229 + finalImageTag = image_tag; 230 + hash = hash; 231 + } 232 + // (if args.arch or null != null then { arch = args.arch; } else { }) 233 + ); 234 + 235 + in 236 + mkFunctor ( 237 + { 238 + input ? ./sources.json, 239 + }: 240 + let 241 + data = 242 + if builtins.isPath input then 243 + # while `readFile` will throw an error anyways if the path doesn't exist, 244 + # we still need to check beforehand because *our* error can be caught but not the one from the builtin 245 + # See: <https://git.lix.systems/lix-project/lix/issues/1098> 246 + if builtins.pathExists input then 247 + builtins.fromJSON (builtins.readFile input) 248 + else 249 + throw "Input path ${toString input} does not exist" 250 + else if builtins.isAttrs input then 251 + input 252 + else 253 + throw "Unsupported input type ${builtins.typeOf input}, must be a path or an attrset"; 254 + version = data.version; 255 + in 256 + if version == 8 then 257 + builtins.mapAttrs (name: spec: mkFunctor (mkSource name spec)) data.pins 258 + else 259 + throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`" 260 + )
+19
npins/sources.json
··· 1 + { 2 + "pins": { 3 + "moxseatd": { 4 + "type": "Git", 5 + "repository": { 6 + "type": "Forgejo", 7 + "server": "https://git.r0chd.pl/", 8 + "owner": "mox-desktop", 9 + "repo": "moxseatd" 10 + }, 11 + "branch": "master", 12 + "submodules": false, 13 + "revision": "0d9604ab7992b71bfd3484a14e7bef7635c0c968", 14 + "url": "https://git.r0chd.pl/mox-desktop/moxseatd/archive/0d9604ab7992b71bfd3484a14e7bef7635c0c968.tar.gz", 15 + "hash": "sha256-Fm8vEhglZ7Kz4afsJyqpg3nbAvISoT0Q03fUKXdKCC4=" 16 + } 17 + }, 18 + "version": 8 19 + }
+2 -2
pam/Cargo.toml
··· 18 18 ] } 19 19 libc = "0.2" 20 20 users = "0.11.0" 21 - hyprwire = "0.4.1" 21 + hyprwire = "0.4.2" 22 22 23 23 [build-dependencies] 24 - hyprwire-scanner = "0.4.1" 24 + hyprwire-scanner = "0.4.2"