Skip to content

Commit

Permalink
Add programs.dwarffs.enable
Browse files Browse the repository at this point in the history
  • Loading branch information
amarshall committed Apr 21, 2022
1 parent e768ce3 commit 566e0e6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ this:
}
```

Then set `programs.dwarffs.enable = true;`.

You may also need an unstable version of Nix, which can be obtained
from the `nix` flake:

Expand Down
35 changes: 21 additions & 14 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,28 +71,35 @@
});

nixosModules.dwarffs =
{ pkgs, ... }:
{ config, lib, pkgs, ... }:
let cfg = config.programs.dwarffs;
in
{
nixpkgs.overlays = [ self.overlay ];
options = {
programs.dwarffs.enable = lib.mkEnableOption "Dwarffs, FUSE filesystem for DWARF debug info from the NixOS cache";
};

systemd.packages = [ pkgs.dwarffs ];
config = lib.mkIf cfg.enable {
nixpkgs.overlays = [ self.overlay ];

system.fsPackages = [ pkgs.dwarffs ];
systemd.packages = [ pkgs.dwarffs ];

systemd.units."run-dwarffs.automount".wantedBy = [ "multi-user.target" ];
system.fsPackages = [ pkgs.dwarffs ];

environment.variables.NIX_DEBUG_INFO_DIRS = [ "/run/dwarffs" ];
systemd.units."run-dwarffs.automount".wantedBy = [ "multi-user.target" ];

systemd.tmpfiles.rules = [ "d /var/cache/dwarffs 0755 dwarffs dwarffs 7d" ];
environment.variables.NIX_DEBUG_INFO_DIRS = [ "/run/dwarffs" ];

users.users.dwarffs =
{ description = "Debug symbols file system daemon user";
group = "dwarffs";
isSystemUser = true;
};
systemd.tmpfiles.rules = [ "d /var/cache/dwarffs 0755 dwarffs dwarffs 7d" ];

users.groups.dwarffs = {};
};
users.users.dwarffs =
{ description = "Debug symbols file system daemon user";
group = "dwarffs";
isSystemUser = true;
};

users.groups.dwarffs = {};
};
};
};
}

0 comments on commit 566e0e6

Please sign in to comment.