mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 00:57:22 +01:00
refactor: lib, flake.nix
This commit is contained in:
parent
a0f4384034
commit
b71bb5794a
27 changed files with 540 additions and 706 deletions
|
|
@ -22,7 +22,7 @@
|
|||
vershell
|
||||
eontimer
|
||||
|
||||
bootstrap
|
||||
swarsel-bootstrap
|
||||
|
||||
(pkgs.writeScriptBin "project" ''
|
||||
#! ${pkgs.bash}/bin/bash
|
||||
|
|
|
|||
|
|
@ -1,14 +1,8 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
mkIfElse = p: yes: no: lib.mkMerge [
|
||||
(lib.mkIf p yes)
|
||||
(lib.mkIf (!p) no)
|
||||
];
|
||||
in
|
||||
{
|
||||
sops = lib.mkIf (!config.swarselsystems.isPublic) {
|
||||
age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/sops" "${config.home.homeDirectory}/.ssh/ssh_host_ed25519_key" ];
|
||||
defaultSopsFile = mkIfElse config.swarselsystems.isBtrfs "/persist/.dotfiles/secrets/general/secrets.yaml" "${config.home.homeDirectory}/.dotfiles/secrets/general/secrets.yaml";
|
||||
defaultSopsFile = lib.swarselsystems.mkIfElseList config.swarselsystems.isBtrfs "/persist/.dotfiles/secrets/general/secrets.yaml" "${config.home.homeDirectory}/.dotfiles/secrets/general/secrets.yaml";
|
||||
|
||||
validateSopsFiles = false;
|
||||
secrets = {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,7 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (config.swarselsystems) monitors;
|
||||
eachMonitor = _name: monitor: {
|
||||
inherit (monitor) name;
|
||||
value = builtins.removeAttrs monitor [ "workspace" "name" "output" ];
|
||||
};
|
||||
eachOutput = _name: monitor: {
|
||||
inherit (monitor) name;
|
||||
value = builtins.removeAttrs monitor [ "mode" "name" "scale" "transform" "position" ];
|
||||
};
|
||||
workplaceSets = lib.mapAttrs' eachOutput monitors;
|
||||
workplaceSets = lib.mapAttrs' lib.swarselsystems.eachOutput monitors;
|
||||
workplaceOutputs = map (key: lib.getAttr key workplaceSets) (lib.attrNames workplaceSets);
|
||||
in
|
||||
{
|
||||
|
|
@ -135,7 +127,7 @@ in
|
|||
};
|
||||
};
|
||||
defaultWorkspace = "workspace 1:一";
|
||||
output = lib.mapAttrs' eachMonitor monitors;
|
||||
output = lib.mapAttrs' lib.swarselsystems.eachMonitor monitors;
|
||||
input = config.swarselsystems.standardinputs;
|
||||
workspaceOutputAssign = workplaceOutputs;
|
||||
startup = config.swarselsystems.startup ++ [
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
mkIfElse = p: yes: no: if p then yes else no;
|
||||
mapperTarget = mkIfElse config.swarselsystems.isCrypted "/dev/mapper/cryptroot" "/dev/disk/by-label/nixos";
|
||||
mapperTarget = lib.swarselsystems.mkIfElse config.swarselsystems.isCrypted "/dev/mapper/cryptroot" "/dev/disk/by-label/nixos";
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
security.sudo.extraConfig = lib.mkIf config.swarselsystems.isImpermanence ''
|
||||
|
|
|
|||
|
|
@ -1,15 +1,9 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
mkIfElse = p: yes: no: lib.mkMerge [
|
||||
(lib.mkIf p yes)
|
||||
(lib.mkIf (!p) no)
|
||||
];
|
||||
in
|
||||
{
|
||||
sops = lib.mkIf (!config.swarselsystems.isPublic) {
|
||||
|
||||
age.sshKeyPaths = mkIfElse config.swarselsystems.isBtrfs [ "/persist/.ssh/sops" "/persist/.ssh/ssh_host_ed25519_key" ] [ "${config.users.users.swarsel.home}/.ssh/sops" "/etc/ssh/ssh_host_ed25519_key" ];
|
||||
defaultSopsFile = mkIfElse config.swarselsystems.isBtrfs "/persist/.dotfiles/secrets/general/secrets.yaml" "${config.users.users.swarsel.home}/.dotfiles/secrets/general/secrets.yaml";
|
||||
age.sshKeyPaths = lib.swarselsystems.mkIfElseList config.swarselsystems.isBtrfs [ "/persist/.ssh/sops" "/persist/.ssh/ssh_host_ed25519_key" ] [ "${config.users.users.swarsel.home}/.ssh/sops" "/etc/ssh/ssh_host_ed25519_key" ];
|
||||
defaultSopsFile = lib.swarselsystems.mkIfElseList config.swarselsystems.isBtrfs "/persist/.dotfiles/secrets/general/secrets.yaml" "${config.users.users.swarsel.home}/.dotfiles/secrets/general/secrets.yaml";
|
||||
|
||||
validateSopsFiles = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue