From 46169bc8c2260035ee07c2b9ff8cdacf492f162c Mon Sep 17 00:00:00 2001 From: kat witch Date: Fri, 7 May 2021 00:49:01 +0100 Subject: [PATCH] Refactor: ..., also: Added vim-lastplace and tmate --- .gitmodules | 6 +- default.nix | 1 - home.nix | 8 --- hosts/samhain/home/sway.nix | 3 - hosts/yule/home/sway.nix | 1 - lib/deploy.nix | 20 +++---- modules/home/default.nix | 1 + modules/home/deploy-tf/default.nix | 33 +++++++++++ modules/nixos/deploy-tf/default.nix | 55 +++++++++--------- nixos.nix | 26 +++++---- pkgs/default.nix | 6 +- private | 1 - profiles/common/{nixos => }/access.nix | 0 profiles/common/{nixos => }/default.nix | 0 profiles/common/{nixos => }/locale.nix | 0 profiles/common/{nixos => }/net.nix | 0 profiles/common/{nixos => }/nix.nix | 0 profiles/common/nixos.nix | 5 -- profiles/common/{nixos => }/packages.nix | 0 profiles/common/{nixos => }/secrets.nix | 0 profiles/common/{nixos => }/ssh.nix | 0 profiles/common/{nixos => }/system.nix | 0 profiles/gui/{nixos => }/adb.nix | 0 profiles/gui/{nixos => }/default.nix | 2 + profiles/gui/{nixos => }/dns.nix | 0 profiles/gui/{nixos => }/firefox.nix | 0 profiles/gui/{nixos => }/fonts.nix | 0 profiles/gui/{nixos => }/gpg.nix | 0 profiles/gui/{nixos => }/mingetty.nix | 0 profiles/gui/{nixos => }/mpd.nix | 0 profiles/gui/{nixos => }/nfs.nix | 0 profiles/gui/nixos.nix | 7 --- profiles/gui/{nixos => }/nixpkgs.nix | 0 profiles/gui/{nixos => }/sound.nix | 0 profiles/laptop/{nixos => }/default.nix | 2 + profiles/laptop/{nixos => }/light.nix | 0 profiles/laptop/nixos.nix | 7 --- profiles/sway/{nixos => }/default.nix | 2 + profiles/sway/nixos.nix | 7 --- profiles/sway/{nixos => }/sway.nix | 0 services/prometheus.nix | 4 +- trusted | 1 + users/kat/{nixos => }/base.nix | 2 +- users/kat/{home => }/base/base16.nix | 0 users/kat/{home => }/base/default.nix | 0 users/kat/{home => }/base/git.nix | 0 users/kat/{home => }/base/kitty.nix | 0 users/kat/{home => }/base/packages.nix | 1 + users/kat/{home => }/base/ssh.nix | 0 users/kat/{home => }/base/tmux.nix | 0 users/kat/{home => }/base/vim/default.nix | 1 + users/kat/{home => }/base/vim/vimrc.nix | 15 +---- users/kat/{home => }/base/weechat.nix | 0 users/kat/{home => }/base/xdg.nix | 0 users/kat/{home => }/base/zsh.nix | 0 users/kat/default.nix | 12 ++-- users/kat/dev.nix | 5 ++ users/kat/{home => }/dev/default.nix | 0 users/kat/{home => }/dev/packages.nix | 0 users/kat/gui.nix | 5 ++ users/kat/{home => }/gui/default.nix | 0 users/kat/{home => }/gui/firefox/default.nix | 0 users/kat/{home => }/gui/firefox/tridactylrc | 0 .../{home => }/gui/firefox/userChrome.css.nix | 0 users/kat/{home => }/gui/gtk.nix | 0 users/kat/{home => }/gui/kitty.nix | 0 users/kat/{home => }/gui/packages.nix | 0 users/kat/{home => }/gui/weechat.nix | 5 -- users/kat/home/default.nix | 5 -- users/kat/home/personal/bitw.nix | 10 ---- users/kat/home/personal/default.nix | 5 -- users/kat/media.nix | 5 ++ users/kat/{home => }/media/beets.nix | 0 users/kat/{home => }/media/default.nix | 0 users/kat/{home => }/media/mpd.nix | 0 users/kat/{home => }/media/mpv.nix | 0 users/kat/{home => }/media/ncmpcpp.nix | 0 users/kat/{home => }/media/obs.nix | 0 users/kat/{home => }/media/packages.nix | 0 users/kat/{home => }/media/syncplay.nix | 0 users/kat/nixos/dev.nix | 5 -- users/kat/nixos/gui.nix | 5 -- users/kat/nixos/media.nix | 5 -- users/kat/nixos/personal.nix | 5 -- users/kat/nixos/sway.nix | 5 -- users/kat/personal.nix | 5 ++ users/kat/personal/default.nix | 5 ++ users/kat/{home => }/personal/gpg.nix | 0 users/kat/{home => }/personal/packages.nix | 0 users/kat/{home => }/personal/secrets.nix | 0 users/kat/sway.nix | 5 ++ users/kat/{home => }/sway/default.nix | 0 users/kat/{home => }/sway/gammastep.nix | 0 users/kat/{home => }/sway/konawall.nix | 0 users/kat/{home => }/sway/mako.nix | 0 users/kat/{home => }/sway/packages.nix | 0 users/kat/{home => }/sway/sway.nix | 0 users/kat/{home => }/sway/swayidle.nix | 0 users/kat/{home => }/sway/wallpapers/left.jpg | Bin users/kat/{home => }/sway/wallpapers/main.png | Bin .../kat/{home => }/sway/wallpapers/right.jpg | Bin users/kat/{home => }/sway/waybar/default.nix | 0 .../kat/{home => }/sway/waybar/waybar.css.nix | 0 103 files changed, 142 insertions(+), 167 deletions(-) delete mode 100644 home.nix create mode 100644 modules/home/deploy-tf/default.nix delete mode 160000 private rename profiles/common/{nixos => }/access.nix (100%) rename profiles/common/{nixos => }/default.nix (100%) rename profiles/common/{nixos => }/locale.nix (100%) rename profiles/common/{nixos => }/net.nix (100%) rename profiles/common/{nixos => }/nix.nix (100%) delete mode 100644 profiles/common/nixos.nix rename profiles/common/{nixos => }/packages.nix (100%) rename profiles/common/{nixos => }/secrets.nix (100%) rename profiles/common/{nixos => }/ssh.nix (100%) rename profiles/common/{nixos => }/system.nix (100%) rename profiles/gui/{nixos => }/adb.nix (100%) rename profiles/gui/{nixos => }/default.nix (90%) rename profiles/gui/{nixos => }/dns.nix (100%) rename profiles/gui/{nixos => }/firefox.nix (100%) rename profiles/gui/{nixos => }/fonts.nix (100%) rename profiles/gui/{nixos => }/gpg.nix (100%) rename profiles/gui/{nixos => }/mingetty.nix (100%) rename profiles/gui/{nixos => }/mpd.nix (100%) rename profiles/gui/{nixos => }/nfs.nix (100%) delete mode 100644 profiles/gui/nixos.nix rename profiles/gui/{nixos => }/nixpkgs.nix (100%) rename profiles/gui/{nixos => }/sound.nix (100%) rename profiles/laptop/{nixos => }/default.nix (56%) rename profiles/laptop/{nixos => }/light.nix (100%) delete mode 100644 profiles/laptop/nixos.nix rename profiles/sway/{nixos => }/default.nix (64%) delete mode 100644 profiles/sway/nixos.nix rename profiles/sway/{nixos => }/sway.nix (100%) create mode 160000 trusted rename users/kat/{nixos => }/base.nix (94%) rename users/kat/{home => }/base/base16.nix (100%) rename users/kat/{home => }/base/default.nix (100%) rename users/kat/{home => }/base/git.nix (100%) rename users/kat/{home => }/base/kitty.nix (100%) rename users/kat/{home => }/base/packages.nix (96%) rename users/kat/{home => }/base/ssh.nix (100%) rename users/kat/{home => }/base/tmux.nix (100%) rename users/kat/{home => }/base/vim/default.nix (98%) rename users/kat/{home => }/base/vim/vimrc.nix (97%) rename users/kat/{home => }/base/weechat.nix (100%) rename users/kat/{home => }/base/xdg.nix (100%) rename users/kat/{home => }/base/zsh.nix (100%) create mode 100644 users/kat/dev.nix rename users/kat/{home => }/dev/default.nix (100%) rename users/kat/{home => }/dev/packages.nix (100%) create mode 100644 users/kat/gui.nix rename users/kat/{home => }/gui/default.nix (100%) rename users/kat/{home => }/gui/firefox/default.nix (100%) rename users/kat/{home => }/gui/firefox/tridactylrc (100%) rename users/kat/{home => }/gui/firefox/userChrome.css.nix (100%) rename users/kat/{home => }/gui/gtk.nix (100%) rename users/kat/{home => }/gui/kitty.nix (100%) rename users/kat/{home => }/gui/packages.nix (100%) rename users/kat/{home => }/gui/weechat.nix (84%) delete mode 100644 users/kat/home/default.nix delete mode 100644 users/kat/home/personal/bitw.nix delete mode 100644 users/kat/home/personal/default.nix create mode 100644 users/kat/media.nix rename users/kat/{home => }/media/beets.nix (100%) rename users/kat/{home => }/media/default.nix (100%) rename users/kat/{home => }/media/mpd.nix (100%) rename users/kat/{home => }/media/mpv.nix (100%) rename users/kat/{home => }/media/ncmpcpp.nix (100%) rename users/kat/{home => }/media/obs.nix (100%) rename users/kat/{home => }/media/packages.nix (100%) rename users/kat/{home => }/media/syncplay.nix (100%) delete mode 100644 users/kat/nixos/dev.nix delete mode 100644 users/kat/nixos/gui.nix delete mode 100644 users/kat/nixos/media.nix delete mode 100644 users/kat/nixos/personal.nix delete mode 100644 users/kat/nixos/sway.nix create mode 100644 users/kat/personal.nix create mode 100644 users/kat/personal/default.nix rename users/kat/{home => }/personal/gpg.nix (100%) rename users/kat/{home => }/personal/packages.nix (100%) rename users/kat/{home => }/personal/secrets.nix (100%) create mode 100644 users/kat/sway.nix rename users/kat/{home => }/sway/default.nix (100%) rename users/kat/{home => }/sway/gammastep.nix (100%) rename users/kat/{home => }/sway/konawall.nix (100%) rename users/kat/{home => }/sway/mako.nix (100%) rename users/kat/{home => }/sway/packages.nix (100%) rename users/kat/{home => }/sway/sway.nix (100%) rename users/kat/{home => }/sway/swayidle.nix (100%) rename users/kat/{home => }/sway/wallpapers/left.jpg (100%) rename users/kat/{home => }/sway/wallpapers/main.png (100%) rename users/kat/{home => }/sway/wallpapers/right.jpg (100%) rename users/kat/{home => }/sway/waybar/default.nix (100%) rename users/kat/{home => }/sway/waybar/waybar.css.nix (100%) diff --git a/.gitmodules b/.gitmodules index e59e24f8..43c15d68 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ -[submodule "config/private"] - path = private - url = "gcrypt::ssh://gitea@git.kittywit.ch:62954/kat/nixfiles-private.git#main" +[submodule "trusted"] + path = trusted branch = main + url = "https://git.kittywit.ch/kat/nixfiles-trusted.git" diff --git a/default.nix b/default.nix index 164bcf54..0643e244 100644 --- a/default.nix +++ b/default.nix @@ -5,7 +5,6 @@ rec { profiles = modList { modulesDir = ./profiles; - defaultFile = "nixos.nix"; }; users = modList { modulesDir = ./users; }; diff --git a/home.nix b/home.nix deleted file mode 100644 index 11fdd808..00000000 --- a/home.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, config, lib, ... }: - -{ - imports = [ ./modules/home ] - ++ lib.optional (builtins.pathExists (./private/profile/home)) - (import ./private/profile/home); -} - diff --git a/hosts/samhain/home/sway.nix b/hosts/samhain/home/sway.nix index e35ce957..d2a164e5 100644 --- a/hosts/samhain/home/sway.nix +++ b/hosts/samhain/home/sway.nix @@ -9,17 +9,14 @@ left = { res = "1920x1080"; pos = "0 0"; - #bg = "${../../../private/files/wallpapers/left.jpg} fill"; }; middle = { res = "1920x1200"; pos = "1920 0"; - #bg = "${../../../private/files/wallpapers/main.png} fill"; }; right = { res = "1920x1080"; pos = "3840 0"; - #bg = "${../../../private/files/wallpapers/right.jpg} fill"; }; in { "DP-1" = left; diff --git a/hosts/yule/home/sway.nix b/hosts/yule/home/sway.nix index eeb4178a..eccd7a0e 100644 --- a/hosts/yule/home/sway.nix +++ b/hosts/yule/home/sway.nix @@ -6,7 +6,6 @@ laptop = { res = "1920x1080"; pos = "0 0"; - #bg = "${../../../private/files/wallpapers/main.png} fill"; }; in { "eDP-1" = laptop; }; diff --git a/lib/deploy.nix b/lib/deploy.nix index 0673ad57..f2bb0dde 100644 --- a/lib/deploy.nix +++ b/lib/deploy.nix @@ -13,13 +13,14 @@ let tf = { targetName, target }: tfEval ({ config, ... }: { - imports = map (hostName: ../hosts + "/${hostName}/meta.nix") target ++ [{ + imports = optional (builtins.pathExists ../trusted/tf) (import ../trusted/tf/meta.nix) + ++ map (hostName: ../hosts + "/${hostName}/meta.nix") target ++ [{ config = mkMerge (map (hostName: mapAttrs (_: mkMerge) hosts.${hostName}.config.deploy.tf.out.set) target); }] ++ optional - (builtins.pathExists (../private/targets + "/${targetName}")) - (../private/targets + "/${targetName}") + (builtins.pathExists (../trusted/targets + "/${targetName}")) + (../trusted/targets + "/${targetName}") ++ optional (builtins.pathExists (../targets + "/${targetName}")) (../targets + "/${targetName}") ++ concatMap (hostName: filter builtins.pathExists @@ -32,10 +33,6 @@ let enable = true; }; - state = { - file = ../private/files/tf + "/terraform-${targetName}.tfstate"; - }; - runners.lazy = { file = ../.; args = [ "--show-trace" ]; @@ -44,11 +41,6 @@ let in "deploy.${attr}.runners.run."; }; - terraform = { - dataDir = ../private/files/tf + "/tfdata/${targetName}"; - logPath = ../private/files/tf + "/terraform-${targetName}.log"; - }; - variables.hcloud_token = { type = "string"; value.shellCommand = "bitw get infra/hcloud_token"; @@ -76,6 +68,10 @@ let key_algorithm = "hmac-sha512"; }; }; + + _module.args = { + inherit targetName; + }; }); in { inherit tf; diff --git a/modules/home/default.nix b/modules/home/default.nix index 1199ac20..6c9df2b4 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -4,6 +4,7 @@ disabledModules = [ "programs/vim.nix" ]; imports = [ ./vim.nix + ./deploy-tf (sources.tf-nix + "/modules/home/secrets.nix") (import (sources.arc-nixexprs + "/modules")).home-manager.base16 (import (sources.arc-nixexprs + "/modules")).home-manager.syncplay diff --git a/modules/home/deploy-tf/default.nix b/modules/home/deploy-tf/default.nix new file mode 100644 index 00000000..16236887 --- /dev/null +++ b/modules/home/deploy-tf/default.nix @@ -0,0 +1,33 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.deploy.tf; + unmergedValues = types.mkOptionType { + name = "unmergedValues"; + merge = loc: defs: map (def: def.value) defs; + }; +in { + + options.deploy.tf = mkOption { + type = types.submodule { + freeformType = types.attrsOf unmergedValues; + + options = { + attrs = mkOption { + type = types.listOf types.str; + default = [ ]; + }; + out.set = mkOption { type = types.unspecified; }; + }; + }; + + }; + config = { + deploy.tf = { + attrs = [ "out" "attrs" ]; + out.set = removeAttrs cfg cfg.attrs; + }; + }; +} diff --git a/modules/nixos/deploy-tf/default.nix b/modules/nixos/deploy-tf/default.nix index 3a3a66c7..e7ab0876 100644 --- a/modules/nixos/deploy-tf/default.nix +++ b/modules/nixos/deploy-tf/default.nix @@ -27,37 +27,40 @@ in { }; config = { - deploy.tf = { + deploy.tf = mkMerge (singleton { attrs = [ "out" "attrs" ]; out.set = removeAttrs cfg cfg.attrs; - }; + deploy.systems.${config.networking.hostName} = + with tf.resources; { + isRemote = + (config.networking.hostName != builtins.getEnv "HOME_HOSTNAME"); + nixosConfig = config; + connection = tf.resources.${config.networking.hostName}.connection.set; + triggers.copy.${config.networking.hostName} = + tf.resources.${config.networking.hostName}.refAttr "id"; + triggers.secrets.${config.networking.hostName} = + tf.resources.${config.networking.hostName}.refAttr "id"; + }; - deploy.tf.deploy.systems.${config.networking.hostName} = - with tf.resources; { - isRemote = - (config.networking.hostName != builtins.getEnv "HOME_HOSTNAME"); - nixosConfig = config; - connection = tf.resources.${config.networking.hostName}.connection.set; - triggers.copy.${config.networking.hostName} = - tf.resources.${config.networking.hostName}.refAttr "id"; - triggers.secrets.${config.networking.hostName} = - tf.resources.${config.networking.hostName}.refAttr "id"; - }; + dns.records."kittywitch_net_${config.networking.hostName}" = + mkIf (config.hexchen.network.enable) { + tld = "kittywit.ch."; + domain = "${config.networking.hostName}.net"; + aaaa.address = config.hexchen.network.address; + }; - deploy.tf.dns.records."kittywitch_net_${config.networking.hostName}" = - mkIf (config.hexchen.network.enable) { - tld = "kittywit.ch."; - domain = "${config.networking.hostName}.net"; - aaaa.address = config.hexchen.network.address; - }; + } ++ mapAttrsToList (_: user: + mapAttrs (_: mkMerge) user.deploy.tf.out.set) + config.home-manager.users); + + security.acme.certs."${config.networking.hostName}.net.kittywit.ch" = + mkIf (config.services.nginx.enable && config.hexchen.network.enable) { + domain = "${config.networking.hostName}.net.kittywit.ch"; + dnsProvider = "rfc2136"; + credentialsFile = config.secrets.files.dns_creds.path; + group = "nginx"; + }; - security.acme.certs."${config.networking.hostName}.net.kittywit.ch" = - mkIf (config.services.nginx.enable && config.hexchen.network.enable) { - domain = "${config.networking.hostName}.net.kittywit.ch"; - dnsProvider = "rfc2136"; - credentialsFile = config.secrets.files.dns_creds.path; - group = "nginx"; - }; _module.args.tf = target.${config.deploy.target}; }; } diff --git a/nixos.nix b/nixos.nix index db33e342..849ea1b9 100644 --- a/nixos.nix +++ b/nixos.nix @@ -1,14 +1,15 @@ -{ pkgs, config, lib, sources, tf, witch, options, hostName, ... }: +{ pkgs, config, lib, sources, tf, witch, options, profiles, hostName, ... }: { imports = - [ (import (./hosts + "/${hostName}/nixos")) ./profiles/common/nixos.nix ] - ++ lib.optional - (builtins.pathExists (./private/hosts + "/${hostName}/nixos")) - (import (./private/hosts + "/${hostName}/nixos")) - ++ lib.optional (builtins.pathExists ./private/profile) - ./private/profile/nixos; + [ (import (./hosts + "/${hostName}/nixos")) profiles.common ] + # trusted check + ++ lib.optional (builtins.pathExists (./trusted/hosts + "/${hostName}/nixos")) (import (./trusted/hosts + "/${hostName}/nixos")) + # trusted default check + ++ lib.optional (builtins.pathExists ./trusted) (import ./trusted/hosts) + # trusted profile check + ++ lib.optional (builtins.pathExists ./trusted/profile) (import ./trusted/profile); options = { deploy.profile.gui = lib.mkEnableOption "graphical system"; @@ -35,11 +36,12 @@ users = { kat = { - imports = [ ./home.nix ] ++ lib.optional - (builtins.pathExists (./hosts + "/${hostName}/home")) - (import (./hosts + "/${hostName}/home")) ++ lib.optional - (builtins.pathExists (./private/hosts + "/${hostName}/home")) - (import (./private/hosts + "/${hostName}/home")); + imports = [ ./modules/home ] + ++ lib.optional (builtins.pathExists (./hosts + "/${hostName}/home")) (import (./hosts + "/${hostName}/home")) + # trusted hosts check + ++ lib.optional (builtins.pathExists (./trusted/hosts + "/${hostName}/home")) (import (./trusted/hosts + "/${hostName}/home")) + # trusted users check + ++ lib.optional (builtins.pathExists ./trusted/users) (import ./trusted/users); options = { deploy.profile.gui = lib.mkEnableOption "graphical system"; diff --git a/pkgs/default.nix b/pkgs/default.nix index ccac89b7..382abbfb 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -49,7 +49,7 @@ let ''; }; - obs-studio = super.obs-studio.override { pipewireSupport = true; }; + obs-studio = super.obs-studio.override { pipewireSupport = true; }; hextorgba = (import ../lib/colorhelpers.nix { inherit (super) lib; }).hextorgba; @@ -70,7 +70,7 @@ let kat-scrot = self.callPackage ./kat-scrot { }; - } // super.lib.optionalAttrs (builtins.pathExists ../private/pkgs) - (import ../private/pkgs { inherit super self; }); + } // super.lib.optionalAttrs (builtins.pathExists ../trusted/pkgs) + (import ../trusted/pkgs { inherit super self; }); in (pkgs.extend (import (sources.arc-nixexprs + "/overlay.nix"))).extend overlay diff --git a/private b/private deleted file mode 160000 index efaf2cc6..00000000 --- a/private +++ /dev/null @@ -1 +0,0 @@ -Subproject commit efaf2cc6461d43ace6b7f2d7e30e0e6c4de1e5c4 diff --git a/profiles/common/nixos/access.nix b/profiles/common/access.nix similarity index 100% rename from profiles/common/nixos/access.nix rename to profiles/common/access.nix diff --git a/profiles/common/nixos/default.nix b/profiles/common/default.nix similarity index 100% rename from profiles/common/nixos/default.nix rename to profiles/common/default.nix diff --git a/profiles/common/nixos/locale.nix b/profiles/common/locale.nix similarity index 100% rename from profiles/common/nixos/locale.nix rename to profiles/common/locale.nix diff --git a/profiles/common/nixos/net.nix b/profiles/common/net.nix similarity index 100% rename from profiles/common/nixos/net.nix rename to profiles/common/net.nix diff --git a/profiles/common/nixos/nix.nix b/profiles/common/nix.nix similarity index 100% rename from profiles/common/nixos/nix.nix rename to profiles/common/nix.nix diff --git a/profiles/common/nixos.nix b/profiles/common/nixos.nix deleted file mode 100644 index a968aa2a..00000000 --- a/profiles/common/nixos.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - imports = [ ./nixos ]; -} diff --git a/profiles/common/nixos/packages.nix b/profiles/common/packages.nix similarity index 100% rename from profiles/common/nixos/packages.nix rename to profiles/common/packages.nix diff --git a/profiles/common/nixos/secrets.nix b/profiles/common/secrets.nix similarity index 100% rename from profiles/common/nixos/secrets.nix rename to profiles/common/secrets.nix diff --git a/profiles/common/nixos/ssh.nix b/profiles/common/ssh.nix similarity index 100% rename from profiles/common/nixos/ssh.nix rename to profiles/common/ssh.nix diff --git a/profiles/common/nixos/system.nix b/profiles/common/system.nix similarity index 100% rename from profiles/common/nixos/system.nix rename to profiles/common/system.nix diff --git a/profiles/gui/nixos/adb.nix b/profiles/gui/adb.nix similarity index 100% rename from profiles/gui/nixos/adb.nix rename to profiles/gui/adb.nix diff --git a/profiles/gui/nixos/default.nix b/profiles/gui/default.nix similarity index 90% rename from profiles/gui/nixos/default.nix rename to profiles/gui/default.nix index f8f2ea57..32ba5d60 100644 --- a/profiles/gui/nixos/default.nix +++ b/profiles/gui/default.nix @@ -16,4 +16,6 @@ hardware.opengl.extraPackages = with pkgs; [ libvdpau-va-gl ]; services.tumbler.enable = true; + + deploy.profile.gui = true; } diff --git a/profiles/gui/nixos/dns.nix b/profiles/gui/dns.nix similarity index 100% rename from profiles/gui/nixos/dns.nix rename to profiles/gui/dns.nix diff --git a/profiles/gui/nixos/firefox.nix b/profiles/gui/firefox.nix similarity index 100% rename from profiles/gui/nixos/firefox.nix rename to profiles/gui/firefox.nix diff --git a/profiles/gui/nixos/fonts.nix b/profiles/gui/fonts.nix similarity index 100% rename from profiles/gui/nixos/fonts.nix rename to profiles/gui/fonts.nix diff --git a/profiles/gui/nixos/gpg.nix b/profiles/gui/gpg.nix similarity index 100% rename from profiles/gui/nixos/gpg.nix rename to profiles/gui/gpg.nix diff --git a/profiles/gui/nixos/mingetty.nix b/profiles/gui/mingetty.nix similarity index 100% rename from profiles/gui/nixos/mingetty.nix rename to profiles/gui/mingetty.nix diff --git a/profiles/gui/nixos/mpd.nix b/profiles/gui/mpd.nix similarity index 100% rename from profiles/gui/nixos/mpd.nix rename to profiles/gui/mpd.nix diff --git a/profiles/gui/nixos/nfs.nix b/profiles/gui/nfs.nix similarity index 100% rename from profiles/gui/nixos/nfs.nix rename to profiles/gui/nfs.nix diff --git a/profiles/gui/nixos.nix b/profiles/gui/nixos.nix deleted file mode 100644 index 17113098..00000000 --- a/profiles/gui/nixos.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - imports = [ ./nixos ]; - - deploy.profile.gui = true; -} diff --git a/profiles/gui/nixos/nixpkgs.nix b/profiles/gui/nixpkgs.nix similarity index 100% rename from profiles/gui/nixos/nixpkgs.nix rename to profiles/gui/nixpkgs.nix diff --git a/profiles/gui/nixos/sound.nix b/profiles/gui/sound.nix similarity index 100% rename from profiles/gui/nixos/sound.nix rename to profiles/gui/sound.nix diff --git a/profiles/laptop/nixos/default.nix b/profiles/laptop/default.nix similarity index 56% rename from profiles/laptop/nixos/default.nix rename to profiles/laptop/default.nix index 9fcbd47d..6ddb882f 100644 --- a/profiles/laptop/nixos/default.nix +++ b/profiles/laptop/default.nix @@ -2,4 +2,6 @@ { imports = [ ./light.nix ]; + + deploy.profile.laptop = true; } diff --git a/profiles/laptop/nixos/light.nix b/profiles/laptop/light.nix similarity index 100% rename from profiles/laptop/nixos/light.nix rename to profiles/laptop/light.nix diff --git a/profiles/laptop/nixos.nix b/profiles/laptop/nixos.nix deleted file mode 100644 index d675e3eb..00000000 --- a/profiles/laptop/nixos.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ lib, ... }: - -{ - imports = [ ./nixos ]; - - deploy.profile.laptop = true; -} diff --git a/profiles/sway/nixos/default.nix b/profiles/sway/default.nix similarity index 64% rename from profiles/sway/nixos/default.nix rename to profiles/sway/default.nix index 14566c45..5bb40515 100644 --- a/profiles/sway/nixos/default.nix +++ b/profiles/sway/default.nix @@ -2,4 +2,6 @@ { imports = [ ./sway.nix ]; + + deploy.profile.sway = true; } diff --git a/profiles/sway/nixos.nix b/profiles/sway/nixos.nix deleted file mode 100644 index 41ee2514..00000000 --- a/profiles/sway/nixos.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ lib, ... }: - -{ - imports = [ ./nixos ]; - - deploy.profile.sway = true; -} diff --git a/profiles/sway/nixos/sway.nix b/profiles/sway/sway.nix similarity index 100% rename from profiles/sway/nixos/sway.nix rename to profiles/sway/sway.nix diff --git a/services/prometheus.nix b/services/prometheus.nix index 13a3ef89..d2980178 100644 --- a/services/prometheus.nix +++ b/services/prometheus.nix @@ -15,8 +15,8 @@ in { enable = true; scrapeConfigs = [ { - job_name = "boline"; - static_configs = [{ targets = [ "boline.net.kittywit.ch:8002" ]; }]; + job_name = "boline"; + static_configs = [{ targets = [ "boline.net.kittywit.ch:8002" ]; }]; } { job_name = "samhain-vm"; diff --git a/trusted b/trusted new file mode 160000 index 00000000..e9434298 --- /dev/null +++ b/trusted @@ -0,0 +1 @@ +Subproject commit e943429855fe24e3b787f26a1f5c528a66ff02be diff --git a/users/kat/nixos/base.nix b/users/kat/base.nix similarity index 94% rename from users/kat/nixos/base.nix rename to users/kat/base.nix index d1e8d297..d6526582 100644 --- a/users/kat/nixos/base.nix +++ b/users/kat/base.nix @@ -1,7 +1,7 @@ { config, pkgs, lib, ... }: { - home-manager.users.kat = { imports = [ ../home/base ]; }; + home-manager.users.kat = { imports = [ ./base ]; }; users.users.kat = { uid = 1000; diff --git a/users/kat/home/base/base16.nix b/users/kat/base/base16.nix similarity index 100% rename from users/kat/home/base/base16.nix rename to users/kat/base/base16.nix diff --git a/users/kat/home/base/default.nix b/users/kat/base/default.nix similarity index 100% rename from users/kat/home/base/default.nix rename to users/kat/base/default.nix diff --git a/users/kat/home/base/git.nix b/users/kat/base/git.nix similarity index 100% rename from users/kat/home/base/git.nix rename to users/kat/base/git.nix diff --git a/users/kat/home/base/kitty.nix b/users/kat/base/kitty.nix similarity index 100% rename from users/kat/home/base/kitty.nix rename to users/kat/base/kitty.nix diff --git a/users/kat/home/base/packages.nix b/users/kat/base/packages.nix similarity index 96% rename from users/kat/home/base/packages.nix rename to users/kat/base/packages.nix index 761b44de..9077cada 100644 --- a/users/kat/home/base/packages.nix +++ b/users/kat/base/packages.nix @@ -2,6 +2,7 @@ { home.packages = with pkgs; [ + tmate htop fd sd diff --git a/users/kat/home/base/ssh.nix b/users/kat/base/ssh.nix similarity index 100% rename from users/kat/home/base/ssh.nix rename to users/kat/base/ssh.nix diff --git a/users/kat/home/base/tmux.nix b/users/kat/base/tmux.nix similarity index 100% rename from users/kat/home/base/tmux.nix rename to users/kat/base/tmux.nix diff --git a/users/kat/home/base/vim/default.nix b/users/kat/base/vim/default.nix similarity index 98% rename from users/kat/home/base/vim/default.nix rename to users/kat/base/vim/default.nix index 9a76ffcc..fbd5498a 100644 --- a/users/kat/home/base/vim/default.nix +++ b/users/kat/base/vim/default.nix @@ -23,6 +23,7 @@ vim-startify vim-airline vim-airline-themes + vim-lastplace base16-vim ]; #extraPackages = with pkgs; diff --git a/users/kat/home/base/vim/vimrc.nix b/users/kat/base/vim/vimrc.nix similarity index 97% rename from users/kat/home/base/vim/vimrc.nix rename to users/kat/base/vim/vimrc.nix index 31937bdf..1ed3def6 100644 --- a/users/kat/home/base/vim/vimrc.nix +++ b/users/kat/base/vim/vimrc.nix @@ -22,6 +22,9 @@ let g:notmuch_search_date_format='%Y/%m/%d %H:%M' let g:notmuch_html_converter='${pkgs.elinks}/bin/elinks --dump' + " lastplace + let g:lastplace_ignore = "gitcommit,gitrebase,svn,hgcommit" + autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | \ quit | endif autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 | @@ -52,18 +55,6 @@ set relativenumber set completeopt=longest,menuone - function! ResCur() - if line("'\"") <= line("$") - normal! g`" - return 1 - endif - endfunction - - augroup resCur - autocmd! - autocmd BufWinEnter * call ResCur() - augroup END - inoremap \ pumvisible() ? "\" : \ check_back_space() ? "\" : diff --git a/users/kat/home/base/weechat.nix b/users/kat/base/weechat.nix similarity index 100% rename from users/kat/home/base/weechat.nix rename to users/kat/base/weechat.nix diff --git a/users/kat/home/base/xdg.nix b/users/kat/base/xdg.nix similarity index 100% rename from users/kat/home/base/xdg.nix rename to users/kat/base/xdg.nix diff --git a/users/kat/home/base/zsh.nix b/users/kat/base/zsh.nix similarity index 100% rename from users/kat/home/base/zsh.nix rename to users/kat/base/zsh.nix diff --git a/users/kat/default.nix b/users/kat/default.nix index 010a09b5..0ef42f6b 100644 --- a/users/kat/default.nix +++ b/users/kat/default.nix @@ -1,10 +1,10 @@ rec { - base = ./nixos/base.nix; - gui = ./nixos/gui.nix; - sway = ./nixos/sway.nix; - dev = ./nixos/dev.nix; - media = ./nixos/media.nix; - personal = ./nixos/personal.nix; + base = ./base.nix; + gui = ./gui.nix; + sway = ./sway.nix; + dev = ./dev.nix; + media = ./media.nix; + personal = ./personal.nix; server = { imports = [ personal ]; }; guiFull = { imports = [ gui sway dev media personal ]; }; diff --git a/users/kat/dev.nix b/users/kat/dev.nix new file mode 100644 index 00000000..df631346 --- /dev/null +++ b/users/kat/dev.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + home-manager.users.kat = { imports = [ ./dev ]; }; +} diff --git a/users/kat/home/dev/default.nix b/users/kat/dev/default.nix similarity index 100% rename from users/kat/home/dev/default.nix rename to users/kat/dev/default.nix diff --git a/users/kat/home/dev/packages.nix b/users/kat/dev/packages.nix similarity index 100% rename from users/kat/home/dev/packages.nix rename to users/kat/dev/packages.nix diff --git a/users/kat/gui.nix b/users/kat/gui.nix new file mode 100644 index 00000000..7a8e0af0 --- /dev/null +++ b/users/kat/gui.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + home-manager.users.kat = { imports = [ ./gui ]; }; +} diff --git a/users/kat/home/gui/default.nix b/users/kat/gui/default.nix similarity index 100% rename from users/kat/home/gui/default.nix rename to users/kat/gui/default.nix diff --git a/users/kat/home/gui/firefox/default.nix b/users/kat/gui/firefox/default.nix similarity index 100% rename from users/kat/home/gui/firefox/default.nix rename to users/kat/gui/firefox/default.nix diff --git a/users/kat/home/gui/firefox/tridactylrc b/users/kat/gui/firefox/tridactylrc similarity index 100% rename from users/kat/home/gui/firefox/tridactylrc rename to users/kat/gui/firefox/tridactylrc diff --git a/users/kat/home/gui/firefox/userChrome.css.nix b/users/kat/gui/firefox/userChrome.css.nix similarity index 100% rename from users/kat/home/gui/firefox/userChrome.css.nix rename to users/kat/gui/firefox/userChrome.css.nix diff --git a/users/kat/home/gui/gtk.nix b/users/kat/gui/gtk.nix similarity index 100% rename from users/kat/home/gui/gtk.nix rename to users/kat/gui/gtk.nix diff --git a/users/kat/home/gui/kitty.nix b/users/kat/gui/kitty.nix similarity index 100% rename from users/kat/home/gui/kitty.nix rename to users/kat/gui/kitty.nix diff --git a/users/kat/home/gui/packages.nix b/users/kat/gui/packages.nix similarity index 100% rename from users/kat/home/gui/packages.nix rename to users/kat/gui/packages.nix diff --git a/users/kat/home/gui/weechat.nix b/users/kat/gui/weechat.nix similarity index 84% rename from users/kat/home/gui/weechat.nix rename to users/kat/gui/weechat.nix index 9d14b5e4..a8c17f40 100644 --- a/users/kat/home/gui/weechat.nix +++ b/users/kat/gui/weechat.nix @@ -1,11 +1,6 @@ { config, pkgs, lib, superConfig, ... }: { - home.file = { - ".local/share/weechat/sec.conf" = lib.mkIf config.deploy.profile.private { - source = ../../../../private/files/weechat/sec.conf; - }; - }; programs.weechat = { enable = true; config = { diff --git a/users/kat/home/default.nix b/users/kat/home/default.nix deleted file mode 100644 index d2753eb8..00000000 --- a/users/kat/home/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -rec { - base = ./base; - sway = ./sway; - gui = ./gui; -} diff --git a/users/kat/home/personal/bitw.nix b/users/kat/home/personal/bitw.nix deleted file mode 100644 index 46ed1c43..00000000 --- a/users/kat/home/personal/bitw.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, ... }: - -{ - xdg.configFile."rbw/config.json".text = builtins.toJSON { - email = "kat@kittywit.ch"; - base_url = "https://vault.kittywit.ch"; - identity_url = null; - lock_timeout = 3600; - }; -} diff --git a/users/kat/home/personal/default.nix b/users/kat/home/personal/default.nix deleted file mode 100644 index 484baa53..00000000 --- a/users/kat/home/personal/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - imports = [ ./secrets.nix ./bitw.nix ./gpg.nix ./packages.nix ]; -} diff --git a/users/kat/media.nix b/users/kat/media.nix new file mode 100644 index 00000000..381260ea --- /dev/null +++ b/users/kat/media.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + home-manager.users.kat = { imports = [ ./media ]; }; +} diff --git a/users/kat/home/media/beets.nix b/users/kat/media/beets.nix similarity index 100% rename from users/kat/home/media/beets.nix rename to users/kat/media/beets.nix diff --git a/users/kat/home/media/default.nix b/users/kat/media/default.nix similarity index 100% rename from users/kat/home/media/default.nix rename to users/kat/media/default.nix diff --git a/users/kat/home/media/mpd.nix b/users/kat/media/mpd.nix similarity index 100% rename from users/kat/home/media/mpd.nix rename to users/kat/media/mpd.nix diff --git a/users/kat/home/media/mpv.nix b/users/kat/media/mpv.nix similarity index 100% rename from users/kat/home/media/mpv.nix rename to users/kat/media/mpv.nix diff --git a/users/kat/home/media/ncmpcpp.nix b/users/kat/media/ncmpcpp.nix similarity index 100% rename from users/kat/home/media/ncmpcpp.nix rename to users/kat/media/ncmpcpp.nix diff --git a/users/kat/home/media/obs.nix b/users/kat/media/obs.nix similarity index 100% rename from users/kat/home/media/obs.nix rename to users/kat/media/obs.nix diff --git a/users/kat/home/media/packages.nix b/users/kat/media/packages.nix similarity index 100% rename from users/kat/home/media/packages.nix rename to users/kat/media/packages.nix diff --git a/users/kat/home/media/syncplay.nix b/users/kat/media/syncplay.nix similarity index 100% rename from users/kat/home/media/syncplay.nix rename to users/kat/media/syncplay.nix diff --git a/users/kat/nixos/dev.nix b/users/kat/nixos/dev.nix deleted file mode 100644 index d8ce54ab..00000000 --- a/users/kat/nixos/dev.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - home-manager.users.kat = { imports = [ ../home/dev ]; }; -} diff --git a/users/kat/nixos/gui.nix b/users/kat/nixos/gui.nix deleted file mode 100644 index 7d5fb802..00000000 --- a/users/kat/nixos/gui.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - home-manager.users.kat = { imports = [ ../home/gui ]; }; -} diff --git a/users/kat/nixos/media.nix b/users/kat/nixos/media.nix deleted file mode 100644 index fbabc67d..00000000 --- a/users/kat/nixos/media.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - home-manager.users.kat = { imports = [ ../home/media ]; }; -} diff --git a/users/kat/nixos/personal.nix b/users/kat/nixos/personal.nix deleted file mode 100644 index f4bef3de..00000000 --- a/users/kat/nixos/personal.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - home-manager.users.kat = { imports = [ ../home/personal ]; }; -} diff --git a/users/kat/nixos/sway.nix b/users/kat/nixos/sway.nix deleted file mode 100644 index b88ad26f..00000000 --- a/users/kat/nixos/sway.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - home-manager.users.kat = { imports = [ ../home/sway ]; }; -} diff --git a/users/kat/personal.nix b/users/kat/personal.nix new file mode 100644 index 00000000..40f899aa --- /dev/null +++ b/users/kat/personal.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + home-manager.users.kat = { imports = [ ./personal ]; }; +} diff --git a/users/kat/personal/default.nix b/users/kat/personal/default.nix new file mode 100644 index 00000000..41953cdc --- /dev/null +++ b/users/kat/personal/default.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + imports = [ ./secrets.nix ./gpg.nix ./packages.nix ]; +} diff --git a/users/kat/home/personal/gpg.nix b/users/kat/personal/gpg.nix similarity index 100% rename from users/kat/home/personal/gpg.nix rename to users/kat/personal/gpg.nix diff --git a/users/kat/home/personal/packages.nix b/users/kat/personal/packages.nix similarity index 100% rename from users/kat/home/personal/packages.nix rename to users/kat/personal/packages.nix diff --git a/users/kat/home/personal/secrets.nix b/users/kat/personal/secrets.nix similarity index 100% rename from users/kat/home/personal/secrets.nix rename to users/kat/personal/secrets.nix diff --git a/users/kat/sway.nix b/users/kat/sway.nix new file mode 100644 index 00000000..6218e9d6 --- /dev/null +++ b/users/kat/sway.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + home-manager.users.kat = { imports = [ ./sway ]; }; +} diff --git a/users/kat/home/sway/default.nix b/users/kat/sway/default.nix similarity index 100% rename from users/kat/home/sway/default.nix rename to users/kat/sway/default.nix diff --git a/users/kat/home/sway/gammastep.nix b/users/kat/sway/gammastep.nix similarity index 100% rename from users/kat/home/sway/gammastep.nix rename to users/kat/sway/gammastep.nix diff --git a/users/kat/home/sway/konawall.nix b/users/kat/sway/konawall.nix similarity index 100% rename from users/kat/home/sway/konawall.nix rename to users/kat/sway/konawall.nix diff --git a/users/kat/home/sway/mako.nix b/users/kat/sway/mako.nix similarity index 100% rename from users/kat/home/sway/mako.nix rename to users/kat/sway/mako.nix diff --git a/users/kat/home/sway/packages.nix b/users/kat/sway/packages.nix similarity index 100% rename from users/kat/home/sway/packages.nix rename to users/kat/sway/packages.nix diff --git a/users/kat/home/sway/sway.nix b/users/kat/sway/sway.nix similarity index 100% rename from users/kat/home/sway/sway.nix rename to users/kat/sway/sway.nix diff --git a/users/kat/home/sway/swayidle.nix b/users/kat/sway/swayidle.nix similarity index 100% rename from users/kat/home/sway/swayidle.nix rename to users/kat/sway/swayidle.nix diff --git a/users/kat/home/sway/wallpapers/left.jpg b/users/kat/sway/wallpapers/left.jpg similarity index 100% rename from users/kat/home/sway/wallpapers/left.jpg rename to users/kat/sway/wallpapers/left.jpg diff --git a/users/kat/home/sway/wallpapers/main.png b/users/kat/sway/wallpapers/main.png similarity index 100% rename from users/kat/home/sway/wallpapers/main.png rename to users/kat/sway/wallpapers/main.png diff --git a/users/kat/home/sway/wallpapers/right.jpg b/users/kat/sway/wallpapers/right.jpg similarity index 100% rename from users/kat/home/sway/wallpapers/right.jpg rename to users/kat/sway/wallpapers/right.jpg diff --git a/users/kat/home/sway/waybar/default.nix b/users/kat/sway/waybar/default.nix similarity index 100% rename from users/kat/home/sway/waybar/default.nix rename to users/kat/sway/waybar/default.nix diff --git a/users/kat/home/sway/waybar/waybar.css.nix b/users/kat/sway/waybar/waybar.css.nix similarity index 100% rename from users/kat/home/sway/waybar/waybar.css.nix rename to users/kat/sway/waybar/waybar.css.nix