home-manager: hide behind an enable flag

This commit is contained in:
colin 2022-11-22 05:28:41 +00:00
parent ca43811c16
commit b566910da0
14 changed files with 41 additions and 13 deletions

View File

@ -11,6 +11,7 @@
./vpn.nix
];
sane.home-manager.enable = true;
sane.nixcache.enable-trusted-keys = true;
sane.packages.enableConsolePkgs = true;
sane.packages.enableSystemPkgs = true;

View File

@ -1,5 +1,7 @@
# Terminal UI mail client
{ config, ... }:
{ config, lib, ... }:
lib.mkIf config.sane.home-manager.enable
{
sops.secrets."aerc_accounts" = {
owner = config.users.users.colin.name;

View File

@ -33,6 +33,10 @@ in
];
options = {
sane.home-manager.enable = mkOption {
default = false;
type = types.bool;
};
# attributes to copy directly to home-manager's `wayland.windowManager` option
sane.home-manager.windowManager = mkOption {
default = {};
@ -46,7 +50,7 @@ in
};
};
config = {
config = lib.mkIf cfg.enable {
sane.impermanence.home-dirs = [
"archive"
"dev"

View File

@ -1,4 +1,6 @@
{ ... }:
{ config, lib, ... }:
lib.mkIf config.sane.home-manager.enable
{
# TODO: this should only be enabled on gui devices
# make Discord usable even when client is "outdated"

View File

@ -102,7 +102,7 @@ in
type = types.attrs;
};
};
config = {
config = lib.mkIf config.sane.home-manager.enable {
# XXX: although home-manager calls this option `firefox`, we can use other browsers and it still mostly works.
home-manager.users.colin = lib.mkIf (config.sane.gui.enable) {
programs.firefox = {

View File

@ -1,4 +1,6 @@
{ pkgs, ... }:
{ config, lib, pkgs, ... }:
lib.mkIf config.sane.home-manager.enable
{
home-manager.users.colin.programs.git = {
enable = true;

View File

@ -1,4 +1,6 @@
{ ... }:
{ config, lib, ... }:
lib.mkIf config.sane.home-manager.enable
{
home-manager.users.colin.programs.kitty = {
enable = true;

View File

@ -1,4 +1,6 @@
{ ... }:
{ config, lib, ... }:
lib.mkIf config.sane.home-manager.enable
{
home-manager.users.colin.programs.mpv = {
enable = true;

View File

@ -8,7 +8,10 @@
# it offers a primitive web-server
# and it offers some CLI query tools
{ lib, pkgs, ... }: lib.mkIf false # XXX disabled!
{ config, lib, pkgs, ... }:
# lib.mkIf config.sane.home-manager.enable
lib.mkIf false # XXX disabled!
{
sane.packages.extraUserPkgs = [ pkgs.nb ];

View File

@ -1,4 +1,6 @@
{ pkgs, ... }:
{ config, lib, pkgs, ... }:
lib.mkIf config.sane.home-manager.enable
{
sane.impermanence.home-dirs = [ ".cache/vim-swap" ];

View File

@ -1,4 +1,6 @@
{ config, pkgs, ... }:
{ config, lib, pkgs, ... }:
lib.mkIf config.sane.home-manager.enable
{
home-manager.users.colin = let
host = config.networking.hostName;

View File

@ -1,4 +1,6 @@
{ config, ... }:
{ config, lib, ... }:
lib.mkIf config.sane.home-manager.enable
{
# TODO: this should only be shipped on gui platforms
sops.secrets."sublime_music_config" = {

View File

@ -1,4 +1,6 @@
{ lib, ... }:
{ config, lib, ... }:
lib.mkIf config.sane.home-manager.enable
{
home-manager.users.colin.xdg.configFile."vlc/vlcrc".text =
let

View File

@ -1,4 +1,6 @@
{ ... }:
{ config, lib, ... }:
lib.mkIf config.sane.home-manager.enable
{
# we don't need to full zsh dir -- just the history file --
# but zsh will sometimes backup the history file and we get fewer errors if we do proper mounts instead of symlinks.