programs: port last users & remove the old packages.nix

This commit is contained in:
Colin 2023-02-03 05:26:57 +00:00
parent a76cf03232
commit afb006f6ec
6 changed files with 13 additions and 60 deletions

View File

@ -41,10 +41,12 @@
".config/pulse" # persist pulseaudio volume
];
# sane.packages.enableGuiPkgs = false; # XXX faster builds/imaging for debugging
sane.packages.extraUserPkgs = [
pkgs.plasma5Packages.konsole # terminal
];
sane.programs."pkgs.plasma5Packages.konsole" = {
# more reliable terminal
# TODO: move to gui/phosh
package = pkgs.plasma5Packages.konsole;
enableFor.users.colin = true;
};
sane.nixcache.enable = true;
sane.persist.enable = true;

View File

@ -8,12 +8,13 @@
./services
];
sane.packages.extraUserPkgs = with pkgs; [
sane.programs = {
# for administering services
freshrss
matrix-synapse
signaldctl
];
freshrss.enableFor.user.colin = true;
matrix-synapse.enableFor.user.colin = true;
signaldctl.enableFor.user.colin = true;
};
sane.persist.enable = true;
sane.services.dyn-dns.enable = true;
sane.services.wg-home.enable = true;

View File

@ -49,8 +49,6 @@ in
shell = pkgs.zsh;
packages = builtins.map (p: p.pkg) config.sane.packages.enabledUserPkgs;
# mount encrypted stuff at login
# some other nix pam users:
# - <https://github.com/g00pix/nixconf/blob/32c04f6fa843fed97639dd3f09e157668d3eea1f/profiles/sshfs.nix>

View File

@ -5,7 +5,6 @@
./feeds.nix
./fs
./ids.nix
./packages.nix
./programs.nix
./image.nix
./persist

View File

@ -1,47 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
with pkgs;
let
cfg = config.sane.packages;
pkgSpec = types.submodule {
options = {
pkg = mkOption {
type = types.package;
};
dir = mkOption {
type = types.listOf types.str;
default = [];
description = "list of home-relative paths to persist for this package";
};
private = mkOption {
type = types.listOf types.str;
default = [];
description = "list of home-relative paths to persist (in encrypted format) for this package";
};
};
};
toPkgSpec = types.coercedTo types.package (p: { pkg = p; }) pkgSpec;
in
{
options = {
# packages to deploy to the user's home
sane.packages.extraUserPkgs = mkOption {
default = [ ];
type = types.listOf toPkgSpec;
};
sane.packages.enabledUserPkgs = mkOption {
default = cfg.extraUserPkgs;
type = types.listOf toPkgSpec;
description = "generated from other config options";
};
};
config = {
sane.user.persist.plaintext = concatLists (map (p: p.dir) cfg.enabledUserPkgs);
sane.user.persist.private = concatLists (map (p: p.private) cfg.enabledUserPkgs);
};
}

View File

@ -29,7 +29,7 @@ let
pkgPath = splitString "." name;
in
# package can be inferred by the attr name, allowing shorthand like
# `sane.packages.nano.enable = true;`
# `sane.programs.nano.enable = true;`
# this indexing will throw if the package doesn't exist and the user forgets to specify
# a valid source explicitly.
getAttrFromPath pkgPath pkgs;