mirror of
https://github.com/starr-dusT/dotfiles.git
synced 2025-06-07 12:16:05 -07:00
rework cfg options for programs
This commit is contained in:
parent
24557adfe5
commit
244b244c10
@ -7,5 +7,16 @@ in {
|
|||||||
../programs/borg.nix
|
../programs/borg.nix
|
||||||
../programs/yt-dlp.nix
|
../programs/yt-dlp.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.modules.base-plus.enable = lib.mkEnableOption "base-plus";
|
options.modules.base-plus.enable = lib.mkEnableOption "base-plus";
|
||||||
|
|
||||||
|
config = {
|
||||||
|
modules = {
|
||||||
|
programs = {
|
||||||
|
borg.enable = true;
|
||||||
|
beancount.enable = true;
|
||||||
|
yt-dlp.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@ -7,9 +7,6 @@ in {
|
|||||||
./keyd.nix
|
./keyd.nix
|
||||||
./gnome.nix
|
./gnome.nix
|
||||||
./peripherals.nix
|
./peripherals.nix
|
||||||
../programs/chrome.nix
|
|
||||||
../programs/firefox.nix
|
|
||||||
../programs/kitty.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
options.modules.desktop.enable = lib.mkEnableOption "desktop";
|
options.modules.desktop.enable = lib.mkEnableOption "desktop";
|
||||||
@ -46,5 +43,13 @@ in {
|
|||||||
"application/x-extension-xht" = [ "google-chrome.desktop" ];
|
"application/x-extension-xht" = [ "google-chrome.desktop" ];
|
||||||
"application/pdf" = [ "google-chrome.desktop" ]; };
|
"application/pdf" = [ "google-chrome.desktop" ]; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
modules = {
|
||||||
|
programs = {
|
||||||
|
chrome.enable = true;
|
||||||
|
firefox.enable = true;
|
||||||
|
kitty.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
let cfg = config.modules.programs.appgate-sdp;
|
let cfg = config.modules.programs.appgate-sdp;
|
||||||
in {
|
in {
|
||||||
options.modules.programs.appgate-sdp.enable = lib.mkEnableOption "appgate-sdp";
|
options.modules.programs.appgate-sdp.enable = lib.mkEnableOption "appgate-sdp";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
appgate-sdp
|
appgate-sdp
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
{ config, lib, pkgs, user, ... }:
|
{ config, lib, pkgs, user, ... }:
|
||||||
|
|
||||||
let cfg = config.modules.base-plus;
|
let cfg = config.modules.programs.beancount;
|
||||||
in {
|
in {
|
||||||
|
options.modules.programs.beancount.enable = lib.mkEnableOption "beancount";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
fava # Web interface for the double-entry bookkeeping software Beancount
|
fava # Web interface for the double-entry bookkeeping software Beancount
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
{ config, pkgs, user, lib, ... }:
|
{ config, pkgs, user, lib, ... }:
|
||||||
|
|
||||||
let cfg = config.modules.base-plus;
|
let cfg = config.modules.programs.borg;
|
||||||
in {
|
in {
|
||||||
|
options.modules.programs.borg.enable = lib.mkEnableOption "borg";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
borgbackup # Deduplicating backup program
|
borgbackup # Deduplicating backup program
|
||||||
|
@ -1,26 +1,15 @@
|
|||||||
{ config, lib, pkgs, user, home-manager, ... }:
|
{ config, lib, pkgs, user, home-manager, ... }:
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
chezmoi # Manage your dotfiles across multiple machines, securely
|
||||||
|
];
|
||||||
|
|
||||||
let cfg = config.modules.programs.chezmoi;
|
home-manager.users.${user} = {
|
||||||
in {
|
home.activation.chezmoi = home-manager.lib.hm.dag.entryAfter [ "installPackages" ] ''
|
||||||
options.modules.programs.chezmoi = with lib; {
|
_saved_path=$PATH
|
||||||
apply = lib.mkOption {
|
PATH="${pkgs.git}/bin:$PATH"
|
||||||
type = with types; bool;
|
run ${pkgs.chezmoi}/bin/chezmoi apply --force
|
||||||
default = true;
|
PATH=$_saved_path
|
||||||
};
|
'';
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
chezmoi # Manage your dotfiles across multiple machines, securely
|
|
||||||
];
|
|
||||||
|
|
||||||
home-manager.users.${user} = lib.mkIf cfg.apply {
|
|
||||||
home.activation.chezmoi = home-manager.lib.hm.dag.entryAfter [ "installPackages" ] ''
|
|
||||||
_saved_path=$PATH
|
|
||||||
PATH="${pkgs.git}/bin:$PATH"
|
|
||||||
run ${pkgs.chezmoi}/bin/chezmoi apply --force
|
|
||||||
PATH=$_saved_path
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,7 @@
|
|||||||
|
|
||||||
let cfg = config.modules.programs.chrome;
|
let cfg = config.modules.programs.chrome;
|
||||||
in {
|
in {
|
||||||
options.modules.programs.chrome = with lib; {
|
options.modules.programs.chrome.enable = lib.mkEnableOption "chrome";
|
||||||
enable = lib.mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
@ -2,6 +2,15 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./appgate-sdp.nix
|
./appgate-sdp.nix
|
||||||
|
./beancount.nix
|
||||||
|
./borg.nix
|
||||||
|
./chezmoi.nix
|
||||||
|
./chrome.nix
|
||||||
|
./firefox.nix
|
||||||
|
./git.nix
|
||||||
|
./kitty.nix
|
||||||
|
./nvim.nix
|
||||||
./virt-manager.nix
|
./virt-manager.nix
|
||||||
|
./yt-dlp.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,7 @@
|
|||||||
|
|
||||||
let cfg = config.modules.programs.firefox;
|
let cfg = config.modules.programs.firefox;
|
||||||
in {
|
in {
|
||||||
options.modules.programs.firefox = with lib; {
|
options.modules.programs.firefox.enable = lib.mkEnableOption "firefox";
|
||||||
enable = lib.mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
@ -1,25 +1,14 @@
|
|||||||
{ config, lib, pkgs, user, ... }:
|
{ config, lib, pkgs, user, ... }:
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
git # Version control system for tracking changes in source code during software development
|
||||||
|
git-annex # Manages files with git, without checking the file contents into git
|
||||||
|
lazygit # Terminal-based GUI for git, making it easier to use and visualize git repositories
|
||||||
|
];
|
||||||
|
|
||||||
let cfg = config.modules.programs.git;
|
age.secrets."git/github_personal" = {
|
||||||
in {
|
file = ../../secrets/git/github_personal.age;
|
||||||
options.modules.programs.git = with lib; {
|
owner = "${user}";
|
||||||
keys = lib.mkOption {
|
group = "users";
|
||||||
type = with types; bool;
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
git # Version control system for tracking changes in source code during software development
|
|
||||||
git-annex # Manages files with git, without checking the file contents into git
|
|
||||||
lazygit # Terminal-based GUI for git, making it easier to use and visualize git repositories
|
|
||||||
];
|
|
||||||
|
|
||||||
age.secrets."git/github_personal" = lib.mkIf cfg.keys {
|
|
||||||
file = ../../secrets/git/github_personal.age;
|
|
||||||
owner = "${user}";
|
|
||||||
group = "users";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
{ config, lib, pkgs, user, inputs, home-manager, ... }:
|
{ config, lib, pkgs, user, inputs, home-manager, ... }:
|
||||||
|
|
||||||
let cfg = config.modules.desktop;
|
let cfg = config.modules.programs.kitty;
|
||||||
in {
|
in {
|
||||||
|
options.modules.programs.kitty.enable = lib.mkEnableOption "kitty";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home-manager.users.${user} = {
|
home-manager.users.${user} = {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
let cfg = config.modules.programs.virt-manager;
|
let cfg = config.modules.programs.virt-manager;
|
||||||
in {
|
in {
|
||||||
options.modules.programs.virt-manager.enable = lib.mkEnableOption "virt-manager";
|
options.modules.programs.virt-manager.enable = lib.mkEnableOption "virt-manager";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
virt-manager # Desktop application for managing virtual machines through libvirt
|
virt-manager # Desktop application for managing virtual machines through libvirt
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
{ config, lib, pkgs, user, ... }:
|
{ config, lib, pkgs, user, ... }:
|
||||||
|
|
||||||
let cfg = config.modules.base-plus;
|
let cfg = config.modules.programs.yt-dlp;
|
||||||
in {
|
in {
|
||||||
|
options.modules.programs.yt-dlp.enable = lib.mkEnableOption "yt-dlp";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
yt-dlp # Command-line tool to download videos
|
yt-dlp # Command-line tool to download videos
|
||||||
|
Loading…
x
Reference in New Issue
Block a user