mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat: vars in _module.args instead of options
This commit is contained in:
parent
c3060b2be9
commit
c5c09b0358
11 changed files with 437 additions and 439 deletions
|
|
@ -1,9 +1,9 @@
|
|||
{ self, lib, ... }:
|
||||
{ lib, ... }:
|
||||
let
|
||||
importNames = lib.swarselsystems.readNix "modules/home/common";
|
||||
sharedNames = lib.swarselsystems.readNix "modules/shared";
|
||||
in
|
||||
{
|
||||
imports = lib.swarselsystems.mkImports importNames "modules/home/common" ++ [
|
||||
"${self}/modules/shared/sharedsetup.nix"
|
||||
];
|
||||
imports = lib.swarselsystems.mkImports importNames "modules/home/common" ++
|
||||
lib.swarselsystems.mkImports sharedNames "modules/shared";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{ config, pkgs, lib, vars, ... }:
|
||||
{
|
||||
options.swarselmodules.firefox = lib.mkEnableOption "firefox settings";
|
||||
config = lib.mkIf config.swarselmodules.firefox {
|
||||
|
|
@ -143,7 +143,7 @@
|
|||
"browser.startup.homepage" = "https://lobste.rs";
|
||||
};
|
||||
}
|
||||
config.swarselsystems.firefox;
|
||||
vars.firefox;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
{ lib, config, ... }:
|
||||
{ lib, config, vars, ... }:
|
||||
{
|
||||
options.swarselmodules.stylix = lib.mkEnableOption "stylix settings";
|
||||
config = lib.mkIf config.swarselmodules.stylix {
|
||||
stylix = lib.mkIf (!config.swarselsystems.isNixos) (lib.recursiveUpdate
|
||||
{
|
||||
image = config.swarselsystems.wallpaper;
|
||||
targets = config.swarselsystems.stylixHomeTargets;
|
||||
targets = vars.stylixHomeTargets;
|
||||
}
|
||||
config.swarselsystems.stylix);
|
||||
vars.stylix);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
home.stateVersion = "23.05";
|
||||
imports = [
|
||||
"${self}/modules/home/common/settings.nix"
|
||||
"${self}/modules/shared/sharedsetup.nix"
|
||||
"${self}/modules/shared/options.nix"
|
||||
"${self}/modules/shared/vars.nix"
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ self, config, pkgs, lib, nixosConfig ? config, ... }:
|
||||
{ self, config, pkgs, lib, vars, nixosConfig ? config, ... }:
|
||||
let
|
||||
inherit (config.swarselsystems) homeDir;
|
||||
in
|
||||
|
|
@ -126,7 +126,7 @@ in
|
|||
"browser.startup.homepage" = "${site1}|${site2}";
|
||||
};
|
||||
}
|
||||
config.swarselsystems.firefox;
|
||||
vars.firefox;
|
||||
"${user2}" = lib.recursiveUpdate
|
||||
{
|
||||
inherit isDefault;
|
||||
|
|
@ -135,13 +135,13 @@ in
|
|||
"browser.startup.homepage" = "${site3}";
|
||||
};
|
||||
}
|
||||
config.swarselsystems.firefox;
|
||||
vars.firefox;
|
||||
"${user3}" = lib.recursiveUpdate
|
||||
{
|
||||
inherit isDefault;
|
||||
id = 3;
|
||||
}
|
||||
config.swarselsystems.firefox;
|
||||
vars.firefox;
|
||||
work = lib.recursiveUpdate
|
||||
{
|
||||
inherit isDefault;
|
||||
|
|
@ -150,7 +150,7 @@ in
|
|||
"browser.startup.homepage" = "${site4}|${site5}|${site6}|${site7}";
|
||||
};
|
||||
}
|
||||
config.swarselsystems.firefox;
|
||||
vars.firefox;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ self, lib, config, ... }:
|
||||
{ self, lib, config, vars, ... }:
|
||||
{
|
||||
options.swarselmodules.stylix = lib.mkEnableOption "stylix config";
|
||||
config = {
|
||||
|
|
@ -11,10 +11,10 @@
|
|||
targets.grub.enable = false; # the styling makes grub more ugly
|
||||
image = config.swarselsystems.wallpaper;
|
||||
}
|
||||
config.swarselsystems.stylix);
|
||||
vars.stylix);
|
||||
home-manager.users."${config.swarselsystems.mainUser}" = {
|
||||
stylix = {
|
||||
targets = config.swarselsystems.stylixHomeTargets;
|
||||
targets = vars.stylixHomeTargets;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
{ self, lib, ... }:
|
||||
{ lib, ... }:
|
||||
let
|
||||
importNames = lib.swarselsystems.readNix "modules/nixos/common";
|
||||
sharedNames = lib.swarselsystems.readNix "modules/shared";
|
||||
in
|
||||
{
|
||||
imports = lib.swarselsystems.mkImports importNames "modules/nixos/common" ++ [
|
||||
"${self}/modules/shared/sharedsetup.nix"
|
||||
];
|
||||
|
||||
|
||||
imports = lib.swarselsystems.mkImports importNames "modules/nixos/common" ++
|
||||
lib.swarselsystems.mkImports sharedNames "modules/shared";
|
||||
}
|
||||
|
|
|
|||
67
modules/shared/options.nix
Normal file
67
modules/shared/options.nix
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
{ self, config, lib, ... }:
|
||||
{
|
||||
options.swarselsystems = {
|
||||
withHomeManager = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
};
|
||||
isSwap = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
};
|
||||
swapSize = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "8G";
|
||||
};
|
||||
rootDisk = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
mainUser = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "swarsel";
|
||||
};
|
||||
isCrypted = lib.mkEnableOption "uses full disk encryption";
|
||||
|
||||
isImpermanence = lib.mkEnableOption "use impermanence on this system";
|
||||
isSecureBoot = lib.mkEnableOption "use secure boot on this system";
|
||||
isLaptop = lib.mkEnableOption "laptop host";
|
||||
isNixos = lib.mkEnableOption "nixos host";
|
||||
isPublic = lib.mkEnableOption "is a public machine (no secrets)";
|
||||
isDarwin = lib.mkEnableOption "darwin host";
|
||||
isLinux = lib.mkEnableOption "whether this is a linux machine";
|
||||
isBtrfs = lib.mkEnableOption "use btrfs filesystem";
|
||||
sopsFile = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "${config.swarselsystems.flakePath}/secrets/${config.node.name}/secrets.yaml";
|
||||
};
|
||||
homeDir = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/swarsel";
|
||||
};
|
||||
xdgDir = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/run/user/1000";
|
||||
};
|
||||
flakePath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/swarsel/.dotfiles";
|
||||
};
|
||||
wallpaper = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = "${self}/files/wallpaper/lenovowp.png";
|
||||
};
|
||||
sharescreen = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
lowResolution = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
highResolution = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,72 +1,8 @@
|
|||
{ self, config, lib, pkgs, ... }:
|
||||
{ self, lib, pkgs, ... }:
|
||||
{
|
||||
options.swarselsystems = {
|
||||
withHomeManager = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
};
|
||||
isSwap = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
};
|
||||
swapSize = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "8G";
|
||||
};
|
||||
rootDisk = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
mainUser = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "swarsel";
|
||||
};
|
||||
isCrypted = lib.mkEnableOption "uses full disk encryption";
|
||||
|
||||
isImpermanence = lib.mkEnableOption "use impermanence on this system";
|
||||
isSecureBoot = lib.mkEnableOption "use secure boot on this system";
|
||||
isLaptop = lib.mkEnableOption "laptop host";
|
||||
isNixos = lib.mkEnableOption "nixos host";
|
||||
isPublic = lib.mkEnableOption "is a public machine (no secrets)";
|
||||
isDarwin = lib.mkEnableOption "darwin host";
|
||||
isLinux = lib.mkEnableOption "whether this is a linux machine";
|
||||
isBtrfs = lib.mkEnableOption "use btrfs filesystem";
|
||||
sopsFile = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "${config.swarselsystems.flakePath}/secrets/${config.node.name}/secrets.yaml";
|
||||
};
|
||||
homeDir = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/swarsel";
|
||||
};
|
||||
xdgDir = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/run/user/1000";
|
||||
};
|
||||
flakePath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/swarsel/.dotfiles";
|
||||
};
|
||||
wallpaper = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = "${self}/files/wallpaper/lenovowp.png";
|
||||
};
|
||||
sharescreen = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
lowResolution = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
highResolution = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
|
||||
stylix = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = {
|
||||
_module.args = {
|
||||
vars = {
|
||||
stylix = {
|
||||
polarity = "dark";
|
||||
opacity.popups = 0.5;
|
||||
cursor = {
|
||||
|
|
@ -107,20 +43,15 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
stylixHomeTargets = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = {
|
||||
|
||||
stylixHomeTargets = {
|
||||
emacs.enable = false;
|
||||
waybar.enable = false;
|
||||
sway.useWallpaper = false;
|
||||
firefox.profileNames = [ "default" ];
|
||||
};
|
||||
};
|
||||
|
||||
firefox = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = {
|
||||
firefox = {
|
||||
userChrome = builtins.readFile "${self}/files/firefox/chrome/userChrome.css";
|
||||
extensions = {
|
||||
packages = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||
Loading…
Add table
Add a link
Reference in a new issue