diff --git a/flake.lock b/flake.lock
index 9de7024..21c4dde 100644
--- a/flake.lock
+++ b/flake.lock
@@ -1,5 +1,54 @@
{
"nodes": {
+ "flake-compat": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1650374568,
+ "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
+ "owner": "edolstra",
+ "repo": "flake-compat",
+ "rev": "b4a34015c698c7793d592d66adbab377907a2be8",
+ "type": "github"
+ },
+ "original": {
+ "owner": "edolstra",
+ "repo": "flake-compat",
+ "type": "github"
+ }
+ },
+ "flake-utils": {
+ "locked": {
+ "lastModified": 1644229661,
+ "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "flake-utils-plus": {
+ "inputs": {
+ "flake-utils": "flake-utils"
+ },
+ "locked": {
+ "lastModified": 1657226504,
+ "narHash": "sha256-GIYNjuq4mJlFgqKsZ+YrgzWm0IpA4axA3MCrdKYj7gs=",
+ "owner": "gytis-ivaskevicius",
+ "repo": "flake-utils-plus",
+ "rev": "2bf0f91643c2e5ae38c1b26893ac2927ac9bd82a",
+ "type": "github"
+ },
+ "original": {
+ "owner": "gytis-ivaskevicius",
+ "repo": "flake-utils-plus",
+ "type": "github"
+ }
+ },
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -22,6 +71,42 @@
"type": "github"
}
},
+ "nixlib": {
+ "locked": {
+ "lastModified": 1677373009,
+ "narHash": "sha256-kxhz4QUP8tXa/yVSpEzDDZSEp9FvhzRqZzb+SeUaekw=",
+ "owner": "nix-community",
+ "repo": "nixpkgs.lib",
+ "rev": "c9d4f2476046c6a7a2ce3c2118c48455bf0272ea",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "nixpkgs.lib",
+ "type": "github"
+ }
+ },
+ "nixos-generators": {
+ "inputs": {
+ "nixlib": "nixlib",
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1677928408,
+ "narHash": "sha256-Rus3DPKieGuG4UHdMCCFpKdH8Z2TrobciBLHr4FDAzM=",
+ "owner": "nix-community",
+ "repo": "nixos-generators",
+ "rev": "46158ecda28c81b9150f75c8bce8821d375c1230",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "nixos-generators",
+ "type": "github"
+ }
+ },
"nixpkgs": {
"locked": {
"lastModified": 1676202775,
@@ -38,26 +123,34 @@
"type": "github"
}
},
- "nur": {
- "locked": {
- "lastModified": 1676331896,
- "narHash": "sha256-ih3ehOL4wWaMko+ahkycoq8DQRodDqEbJVg6t7WY2PQ=",
- "owner": "nix-community",
- "repo": "NUR",
- "rev": "e014e89fdfbd65e1fb572f00ea71dc2a9513fe6f",
- "type": "github"
- },
- "original": {
- "owner": "nix-community",
- "repo": "NUR",
- "type": "github"
- }
- },
"root": {
"inputs": {
"home-manager": "home-manager",
+ "nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs",
- "nur": "nur"
+ "snowfall-lib": "snowfall-lib"
+ }
+ },
+ "snowfall-lib": {
+ "inputs": {
+ "flake-compat": "flake-compat",
+ "flake-utils-plus": "flake-utils-plus",
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1667153928,
+ "narHash": "sha256-SbXxxrxWzumig4ytez86B9FFkd9zH/qj+SSiMUwY8bI=",
+ "owner": "snowfallorg",
+ "repo": "lib",
+ "rev": "1ffe7109a0aade9df745432e1f5788cf67a05a3e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "snowfallorg",
+ "repo": "lib",
+ "type": "github"
}
},
"utils": {
diff --git a/flake.nix b/flake.nix
index cbfe272..32b24c3 100644
--- a/flake.nix
+++ b/flake.nix
@@ -3,102 +3,42 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+
home-manager.url = "github:nix-community/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
- nur.url = github:nix-community/NUR;
+
+ nixos-generators.url = "github:nix-community/nixos-generators";
+ nixos-generators.inputs.nixpkgs.follows = "nixpkgs";
+
+ snowfall-lib.url = "github:snowfallorg/lib";
+ snowfall-lib.inputs.nixpkgs.follows = "nixpkgs";
};
- outputs = {
- nixpkgs,
- home-manager,
- nur,
- ...
- }: let
- system = "x86_64-linux";
+ outputs = inputs: let
+ lib = inputs.snowfall-lib.mkLib {
+ inherit inputs;
+ src = ./.;
+ };
+ in
+ lib.mkFlake {
+ overlay-package-namespace = "aa";
- pkgs = import nixpkgs {
- inherit system;
- config = {
- allowUnfree = true;
+ channels-config.allowUnfree = true;
+
+ systems.modules = with inputs; [
+ home-manager.nixosModules.home-manager
+ ];
+
+ outputs-builder = channels: {
+ devShells = {
+ default = channels.nixpkgs.mkShell {
+ name = "DevShell";
+ buildInputs = with channels.nixpkgs; [
+ alejandra
+ nixpkgs-lint
+ ];
+ };
+ };
};
};
-
- lib = nixpkgs.lib;
- in {
- homeManagerConfigurations = {
- alejandro = home-manager.lib.homeManagerConfiguration {
- inherit pkgs;
- modules = [
- ./users/alejandro/home.nix
- {
- home = {
- username = "alejandro";
- homeDirectory = "/home/alejandro";
-
- # This value determines the Home Manager release that your
- # configuration is compatible with. This helps avoid breakage
- # when a new Home Manager release introduces backwards
- # incompatible changes.
- #
- # You can update Home Manager without changing this value. See
- # the Home Manager release notes for a list of state version
- # changes in each release.
- stateVersion = "22.05";
- };
- }
- ];
- };
- };
-
- nixosConfigurations = {
- virtual = lib.nixosSystem {
- inherit system;
-
- modules = [
- ./system/virtual/configuration.nix
- ];
- };
-
- carbon = lib.nixosSystem {
- inherit system;
-
- modules = [
- ./system/carbon/configuration.nix
- ./common/yubikey.nix
- ];
- };
-
- gospel = lib.nixosSystem {
- inherit system;
-
- modules = [
- nur.nixosModules.nur
- ./system/gospel/configuration.nix
- ./common/yubikey.nix
- ];
- };
- };
-
- devShells.${system} = {
- default = pkgs.mkShell {
- name = "nixosbuildshell";
- buildInputs = with pkgs; [
- git
- git-crypt
- nixVersions.stable
- alejandra
- pre-commit
- direnv
- ];
-
- shellHook = ''
- echo "You can apply this flake to your system with nixos-rebuild switch --flake .#"
-
- PATH=${pkgs.writeShellScriptBin "nix" ''
- ${pkgs.nixVersions.stable}/bin/nix --experimental-features "nix-command flakes" "$@"
- ''}/bin:$PATH
- '';
- };
- };
- };
}
diff --git a/modules/apps/firefox/default.nix b/modules/apps/firefox/default.nix
new file mode 100644
index 0000000..c7a592c
--- /dev/null
+++ b/modules/apps/firefox/default.nix
@@ -0,0 +1,16 @@
+{
+ options,
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+with lib; let
+ cfg = config.aa.apps.firefox;
+in {
+ options.aa.apps.firefox = with types; {
+ enable = mkEnableOption "firefox";
+ };
+
+ config = mkIf cfg.enable {environment.systemPackages = with pkgs; [firefox];};
+}
diff --git a/modules/archetypes/workstation/default.nix b/modules/archetypes/workstation/default.nix
new file mode 100644
index 0000000..595565c
--- /dev/null
+++ b/modules/archetypes/workstation/default.nix
@@ -0,0 +1,22 @@
+{
+ options,
+ config,
+ pkgs,
+ lib,
+ ...
+}:
+with lib; let
+ cfg = config.aa.archetypes.workstation;
+in {
+ options.aa.archetypes.workstation = with types; {
+ enable = mkEnableOption "workstation archetype";
+ };
+
+ config = mkIf cfg.enable {
+ aa = {
+ suites = {
+ desktop.enable = true;
+ };
+ };
+ };
+}
diff --git a/modules/desktop/addons/alacritty/default.nix b/modules/desktop/addons/alacritty/default.nix
new file mode 100644
index 0000000..2c36c26
--- /dev/null
+++ b/modules/desktop/addons/alacritty/default.nix
@@ -0,0 +1,48 @@
+{
+ options,
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+with lib; let
+ cfg = config.aa.desktop.addons.alacritty;
+in {
+ options.aa.desktop.addons.alacritty = with types; {
+ enable = mkEnableOption "alacritty";
+ };
+
+ config = mkIf cfg.enable {
+ aa.desktop.addons.fonts.enable = true;
+
+ aa.home = {
+ extraOptions = {
+ programs.alacritty = {
+ enable = true;
+ settings = {
+ window.opacity = 0.9;
+ font = {
+ size = 11.0;
+ normal = {
+ family = "Hack Nerd Font";
+ style = "Regular";
+ };
+ bold = {
+ family = "Hack Nerd Font";
+ style = "Bold";
+ };
+ italic = {
+ family = "Hack Nerd Font";
+ style = "Italic";
+ };
+ bold_italic = {
+ family = "Hack Nerd Font";
+ style = "Bold Italic";
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+}
diff --git a/modules/desktop/addons/fonts/default.nix b/modules/desktop/addons/fonts/default.nix
new file mode 100644
index 0000000..9260b5b
--- /dev/null
+++ b/modules/desktop/addons/fonts/default.nix
@@ -0,0 +1,20 @@
+{
+ options,
+ config,
+ pkgs,
+ lib,
+ ...
+}:
+with lib; let
+ cfg = config.aa.desktop.addons.fonts;
+in {
+ options.aa.desktop.addons.fonts = with types; {
+ enable = mkEnableOption "manage fonts";
+ };
+
+ config = mkIf cfg.enable {
+ fonts.fonts = with pkgs; [
+ (nerdfonts.override {fonts = ["Hack"];})
+ ];
+ };
+}
diff --git a/modules/desktop/addons/rofi/default.nix b/modules/desktop/addons/rofi/default.nix
new file mode 100644
index 0000000..f7af828
--- /dev/null
+++ b/modules/desktop/addons/rofi/default.nix
@@ -0,0 +1,27 @@
+{
+ options,
+ config,
+ pkgs,
+ lib,
+ ...
+}:
+with lib; let
+ cfg = config.aa.desktop.addons.rofi;
+in {
+ options.aa.desktop.addons.rofi = with types; {
+ enable = mkEnableOption "rofi";
+ };
+
+ config = mkIf cfg.enable {
+ aa.home.extraOptions = {
+ programs.rofi = {
+ enable = true;
+ font = "Hack Nerd Font 10";
+ theme = "gruvbox-dark-hard";
+ extraConfig = {
+ show-icons = true;
+ };
+ };
+ };
+ };
+}
diff --git a/modules/desktop/sway/default.nix b/modules/desktop/sway/default.nix
new file mode 100644
index 0000000..2e34a6d
--- /dev/null
+++ b/modules/desktop/sway/default.nix
@@ -0,0 +1,250 @@
+{
+ options,
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+with lib; let
+ cfg = config.aa.desktop.sway;
+ sway_cfg = config.aa.home.extraOptions.wayland.windowManager.sway;
+in {
+ options.aa.desktop.sway = with types; {
+ enable = mkEnableOption "sway";
+ };
+
+ config = mkIf cfg.enable {
+ aa.desktop.addons = {
+ alacritty.enable = true;
+ fonts.enable = true;
+ rofi.enable = true;
+
+ # TODO
+ # playerctl
+ # light
+ # pamixer
+ };
+
+ aa.home.extraOptions = {
+ wayland.windowManager.sway = {
+ enable = true;
+ swaynag.enable = true;
+ wrapperFeatures.gtk = true; # so that gtk works properly
+
+ config = {
+ modifier = "Mod4";
+ terminal = "alacritty";
+ menu = "rofi -show run";
+ workspaceAutoBackAndForth = true;
+
+ colors = {
+ focused = {
+ border = "#2B3C44";
+ background = "#4E3D45";
+ text = "#FFFFFF";
+ indicator = "#333333";
+ childBorder = "#000000";
+ };
+ focusedInactive = {
+ border = "#484848";
+ background = "#333333";
+ text = "#FFFFFF";
+ indicator = "#000000";
+ childBorder = "#000000";
+ };
+ unfocused = {
+ border = "#484848";
+ background = "#333333";
+ text = "#FFFFFF";
+ indicator = "#000000";
+ childBorder = "#000000";
+ };
+ };
+
+ window = {
+ titlebar = true;
+ commands = [
+ {
+ command = "inhibit_idle fullscreen";
+ criteria = {class = ".*";};
+ }
+ ];
+ };
+
+ focus.followMouse = false;
+
+ fonts = {
+ names = ["Hack Nerd Font"];
+ size = 10.0;
+ };
+
+ # TODO: Should this live at the system configuration level?
+ output = {
+ # TODO: Set up wallpaper
+ # "*".bg = "${wallpaper} fill";
+ "eDP-1".scale = "1";
+
+ "Unknown ASUS VG24V 0x00007AAC" = {
+ mode = "1920x1080@120Hz";
+ position = "0 830";
+ };
+
+ "Dell Inc. DELL S2721QS 47W7M43" = {
+ transform = "270";
+ position = "1920 0";
+ };
+ "Dell Inc. DELL S2721QS 4FR7M43".position = "4080 830";
+ };
+
+ modes = {
+ resize = {
+ # left will shrink the containers width
+ # right will grow the containers width
+ # up will shrink the containers height
+ # down will grow the containers height
+ "${sway_cfg.left}" = "resize shrink width 50px";
+ "${sway_cfg.down}" = "resize grow height 50px";
+ "${sway_cfg.up}" = "resize shrink height 50px";
+ "${sway_cfg.right}" = "resize grow width 50px";
+
+ # Ditto, with arrow keys
+ "Left" = "resize shrink width 50px";
+ "Down" = "resize grow height 50px";
+ "Up" = "resize shrink height 50px";
+ "Right" = "resize grow width 50px";
+
+ # Exit resize mode
+ "Insert" = "mode default";
+ "Escape" = "mode default";
+ "Return" = "mode default";
+ };
+
+ nag = {
+ "Ctrl+d" = "mode default";
+
+ "Ctrl+c" = "exec ${nag} --exit";
+ "q" = "exec ${nag} --exit";
+ "Escape" = "exec ${nag} --exit";
+
+ "Return" = "exec ${nag} --confirm";
+
+ "j" = "exec ${nag} --next";
+ "Tab" = "exec ${nag} --next";
+ "Up" = "exec ${nag} --next";
+
+ "k" = "exec ${nag} --prev";
+ "Shift+Tab" = "exec ${nag} prev";
+ "Down" = "exec ${nag} prev";
+ };
+ };
+
+ keybindings = {
+ # Activate modes
+ "${sway_cfg.modifier}+s" = "mode resize";
+
+ # Misc
+ "${sway_cfg.modifier}+Return" = "exec ${sway_cfg.terminal}";
+ "${sway_cfg.modifier}+c" = "kill";
+ "${sway_cfg.modifier}+p" = "exec ${sway_cfg.menu}";
+ "${sway_cfg.modifier}+z" = "reload";
+ "${sway_cfg.modifier}+x" = "exec swaylock -i ${config.home.homeDirectory}/dotfiles/users/alejandro/sway/wallpaper.png";
+
+ # Volume control
+ "XF86AudioRaiseVolume" = " exec 'pamixer --increase 5'";
+ "XF86AudioLowerVolume" = " exec 'pamixer --decrease 5'";
+ "XF86AudioMute" = " exec 'pamixer --toggle-mute'";
+
+ # Music player control
+ "XF86AudioPrev" = "exec 'playerctl previous'";
+ "XF86AudioNext" = "exec 'playerctl next'";
+ "XF86AudioPlay" = "exec 'playerctl play-pause'";
+ "${sway_cfg.modifier}+Down" = "exec 'playerctl pause'";
+ "${sway_cfg.modifier}+Up" = "exec 'playerctl play'";
+ "${sway_cfg.modifier}+Right" = "exec 'playerctl next'";
+ "${sway_cfg.modifier}+Left" = "exec 'playerctl previous'";
+
+ # Backlight keys
+ "XF86MonBrightnessDown" = "exec 'light -U 5'";
+ "XF86MonBrightnessUp" = "exec 'light -A 5'";
+
+ # Navigation
+
+ ## Focus
+
+ ### Move your focus around
+ "${sway_cfg.modifier}+${sway_cfg.left}" = "focus left";
+ "${sway_cfg.modifier}+${sway_cfg.down}" = "focus down";
+ "${sway_cfg.modifier}+${sway_cfg.up}" = "focus up";
+ "${sway_cfg.modifier}+${sway_cfg.right}" = "focus right";
+
+ ### Move the focused window with the same, but add Shift
+ "${sway_cfg.modifier}+Shift+${sway_cfg.left}" = "move left";
+ "${sway_cfg.modifier}+Shift+${sway_cfg.down}" = "move down";
+ "${sway_cfg.modifier}+Shift+${sway_cfg.up}" = "move up";
+ "${sway_cfg.modifier}+Shift+${sway_cfg.right}" = "move right";
+
+ ## Workspaces
+
+ ### Switch to a workspace
+ "${sway_cfg.modifier}+q" = "workspace number 1";
+ "${sway_cfg.modifier}+w" = "workspace number 2";
+ "${sway_cfg.modifier}+e" = "workspace number 3";
+ "${sway_cfg.modifier}+r" = "workspace number 4";
+ "${sway_cfg.modifier}+t" = "workspace number 5";
+ "${sway_cfg.modifier}+y" = "workspace number 6";
+ "${sway_cfg.modifier}+u" = "workspace number 7";
+ "${sway_cfg.modifier}+i" = "workspace number 8";
+ "${sway_cfg.modifier}+o" = "workspace number 9";
+
+ ### Move focused container to workspace
+ "${sway_cfg.modifier}+Shift+q" = "move container to workspace number 1";
+ "${sway_cfg.modifier}+Shift+w" = "move container to workspace number 2";
+ "${sway_cfg.modifier}+Shift+e" = "move container to workspace number 3";
+ "${sway_cfg.modifier}+Shift+r" = "move container to workspace number 4";
+ "${sway_cfg.modifier}+Shift+t" = "move container to workspace number 5";
+ "${sway_cfg.modifier}+Shift+y" = "move container to workspace number 6";
+ "${sway_cfg.modifier}+Shift+u" = "move container to workspace number 7";
+ "${sway_cfg.modifier}+Shift+i" = "move container to workspace number 8";
+ "${sway_cfg.modifier}+Shift+o" = "move container to workspace number 9";
+
+ # Layout
+
+ ## Split direction
+ "${sway_cfg.modifier}+v" = "splith";
+ "${sway_cfg.modifier}+g" = "splitv";
+
+ ## Switch the current container between different layout styles
+ "${sway_cfg.modifier}+b" = "layout stacking";
+ "${sway_cfg.modifier}+n" = "layout tabbed";
+ "${sway_cfg.modifier}+m" = "layout toggle split";
+
+ ## Make the current focus fullscreen
+ "${sway_cfg.modifier}+f" = "fullscreen";
+
+ ## move container between displays
+ "${sway_cfg.modifier}+semicolon" = "move workspace to output right";
+
+ ## Toggle the current focus between tiling and floating mode
+ "${sway_cfg.modifier}+Shift+f" = "floating toggle";
+
+ ## Swap focus between the tiling area and the floating area
+ "${sway_cfg.modifier}+space" = "focus mode_toggle";
+
+ ## Move focus to the parent container
+ "${sway_cfg.modifier}+a" = "focus parent";
+
+ # Scratchpad
+ # Move the currently focused window to the scratchpad
+ "${sway_cfg.modifier}+Shift+minus" = "move scratchpad";
+ # Show the next scratchpad window or hide the focused scratchpad window.
+ # If there are multiple scratchpad windows, this command cycles through them.
+ "${sway_cfg.modifier}+minus" = "scratchpad show";
+
+ # Exit sway (logs you out of your Wayland session)
+ "${sway_cfg.modifier}+Shift+z" = "exec ${nag} -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' -b 'Reload' 'swaymsg reload'";
+ };
+ };
+ };
+ };
+ };
+}
diff --git a/modules/home/default.nix b/modules/home/default.nix
new file mode 100644
index 0000000..9af87dd
--- /dev/null
+++ b/modules/home/default.nix
@@ -0,0 +1,49 @@
+{
+ options,
+ config,
+ pkgs,
+ lib,
+ inputs,
+ ...
+}:
+with lib; let
+ cfg = config.aa.home;
+in {
+ imports = with inputs; [
+ home-manager.nixosModules.home-manager
+ ];
+
+ options.aa.home = with types; {
+ file = mkOption {
+ type = attrs;
+ default = {};
+ description = "A set of files to be manged by home-manager's option.";
+ };
+ configFile = mkOption {
+ type = attrs;
+ default = {};
+ description = "A set of files to be managed by home-manager's .";
+ };
+ extraOptions = mkOption {
+ type = attrs;
+ default = {};
+ description = "Options to pass directly to home-manager.";
+ };
+ };
+
+ config = {
+ aa.home.extraOptions = {
+ home.stateVersion = config.system.stateVersion;
+ home.file = mkAliasDefinitions options.aa.home.file;
+ xdg.enable = true;
+ xdg.configFile = mkAliasDefinitions options.aa.home.configFile;
+ };
+
+ home-manager = {
+ useUserPackages = true;
+
+ users.${config.aa.user.name} =
+ mkAliasDefinitions options.aa.home.extraOptions;
+ };
+ };
+}
diff --git a/modules/nix/default.nix b/modules/nix/default.nix
new file mode 100644
index 0000000..794da9e
--- /dev/null
+++ b/modules/nix/default.nix
@@ -0,0 +1,49 @@
+{
+ options,
+ config,
+ pkgs,
+ lib,
+ ...
+}:
+with lib; let
+ cfg = config.aa.nix;
+in {
+ options.aa.nix = with types; {
+ enable = mkEnableOption "manage nix configuration.";
+ package = mkOption {
+ type = package;
+ default = pkgs.nixVersions.unstable;
+ description = "Which nix package to use.";
+ };
+ };
+
+ config = mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ alejandra
+ ];
+
+ nix = let
+ users = ["root" config.aa.user.name];
+ in {
+ package = cfg.package;
+
+ settings = {
+ experimental-features = "nix-command flakes";
+ trusted-users = users;
+ allowed-users = users;
+ };
+
+ gc = {
+ automatic = true;
+ dates = "weekly";
+ options = "--delete-older-than 30d";
+ };
+
+ # TODO: Not sure if I want this
+ # flake-utils-plus
+ # generateRegistryFromInputs = true;
+ # generateNixPathFromInputs = true;
+ # linkInputs = true;
+ };
+ };
+}
diff --git a/modules/suites/desktop/default.nix b/modules/suites/desktop/default.nix
new file mode 100644
index 0000000..2c8143a
--- /dev/null
+++ b/modules/suites/desktop/default.nix
@@ -0,0 +1,26 @@
+{
+ options,
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+with lib; let
+ cfg = config.aa.suites.desktop;
+in {
+ options.aa.suites.desktop = with lib.types; {
+ enable = mkEnableOption "common desktop configuration";
+ };
+
+ config = mkIf cfg.enable {
+ aa = {
+ desktop = {
+ sway.enable = true;
+ };
+
+ apps = {
+ firefox.enable = true;
+ };
+ };
+ };
+}
diff --git a/modules/user/default.nix b/modules/user/default.nix
new file mode 100644
index 0000000..77b52e3
--- /dev/null
+++ b/modules/user/default.nix
@@ -0,0 +1,45 @@
+{
+ options,
+ config,
+ pkgs,
+ lib,
+ ...
+}:
+with lib; let
+ cfg = config.aa.user;
+in {
+ options.aa.user = with types; {
+ name = mkOption {
+ type = str;
+ default = "alejandro";
+ description = "The name to use for the user account.";
+ };
+ extraGroups = mkOption {
+ type = listOf str;
+ default = ["video" "networkmanager" "docker"];
+ description = "Groups to for the user to be assigned.";
+ };
+ extraOptions = mkOption {
+ type = attrs;
+ default = {};
+ description = "Extra options passed to .";
+ };
+ };
+
+ config = {
+ users.users.${cfg.name} =
+ {
+ isNormalUser = true;
+
+ inherit (cfg) name;
+
+ home = "/home/{$cfg.name}";
+ group = "users";
+
+ shell = pkgs.zsh;
+
+ extraGroups = ["wheel"] ++ cfg.extraGroups;
+ }
+ // cfg.extraOptions;
+ };
+}
diff --git a/systems/x86_64-linux/carbon/configuration.nix b/systems/x86_64-linux/carbon/default.nix
similarity index 96%
rename from systems/x86_64-linux/carbon/configuration.nix
rename to systems/x86_64-linux/carbon/default.nix
index 337abc5..a6df33b 100644
--- a/systems/x86_64-linux/carbon/configuration.nix
+++ b/systems/x86_64-linux/carbon/default.nix
@@ -75,11 +75,11 @@
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
- users.users.alejandro = {
- isNormalUser = true;
- extraGroups = ["wheel" "video" "networkmanager"];
- shell = pkgs.zsh;
- };
+ # users.users.alejandro = {
+ # isNormalUser = true;
+ # extraGroups = ["wheel" "video" "networkmanager"];
+ # shell = pkgs.zsh;
+ # };
fonts.fonts = with pkgs; [
(nerdfonts.override {fonts = ["Hack"];})
diff --git a/systems/x86_64-linux/gospel/configuration.nix b/systems/x86_64-linux/gospel/default.nix
similarity index 96%
rename from systems/x86_64-linux/gospel/configuration.nix
rename to systems/x86_64-linux/gospel/default.nix
index 26deb3d..50b1618 100644
--- a/systems/x86_64-linux/gospel/configuration.nix
+++ b/systems/x86_64-linux/gospel/default.nix
@@ -77,11 +77,11 @@
# Enable touchpad support (enabled default in most desktopManager).
# Define a user account. Don't forget to set a password with ‘passwd’.
- users.users.alejandro = {
- isNormalUser = true;
- extraGroups = ["wheel" "video" "networkmanager" "docker"];
- shell = pkgs.zsh;
- };
+ # users.users.alejandro = {
+ # isNormalUser = true;
+ # extraGroups = ["wheel" "video" "networkmanager" "docker"];
+ # shell = pkgs.zsh;
+ # };
programs.sway = {
enable = true;
@@ -110,7 +110,7 @@
pavucontrol
cachix
nixos-generators
- config.nur.repos.mic92.yubikey-touch-detector
+ # config.nur.repos.mic92.yubikey-touch-detector
cryptsetup
paperkey
diff --git a/users/alejandro/alacritty.nix b/users_bak/alejandro/alacritty.nix
similarity index 100%
rename from users/alejandro/alacritty.nix
rename to users_bak/alejandro/alacritty.nix
diff --git a/users/alejandro/git.nix b/users_bak/alejandro/git.nix
similarity index 100%
rename from users/alejandro/git.nix
rename to users_bak/alejandro/git.nix
diff --git a/users/alejandro/gpg.nix b/users_bak/alejandro/gpg.nix
similarity index 100%
rename from users/alejandro/gpg.nix
rename to users_bak/alejandro/gpg.nix
diff --git a/users/alejandro/home.nix b/users_bak/alejandro/home.nix
similarity index 100%
rename from users/alejandro/home.nix
rename to users_bak/alejandro/home.nix
diff --git a/users/alejandro/mako.nix b/users_bak/alejandro/mako.nix
similarity index 100%
rename from users/alejandro/mako.nix
rename to users_bak/alejandro/mako.nix
diff --git a/users/alejandro/neovim.nix b/users_bak/alejandro/neovim.nix
similarity index 100%
rename from users/alejandro/neovim.nix
rename to users_bak/alejandro/neovim.nix
diff --git a/users/alejandro/p10k/p10k.zsh b/users_bak/alejandro/p10k/p10k.zsh
similarity index 100%
rename from users/alejandro/p10k/p10k.zsh
rename to users_bak/alejandro/p10k/p10k.zsh
diff --git a/users/alejandro/rofi.nix b/users_bak/alejandro/rofi.nix
similarity index 100%
rename from users/alejandro/rofi.nix
rename to users_bak/alejandro/rofi.nix
diff --git a/users/alejandro/sway/keybindings.nix b/users_bak/alejandro/sway/keybindings.nix
similarity index 100%
rename from users/alejandro/sway/keybindings.nix
rename to users_bak/alejandro/sway/keybindings.nix
diff --git a/users/alejandro/sway/sway.nix b/users_bak/alejandro/sway/sway.nix
similarity index 100%
rename from users/alejandro/sway/sway.nix
rename to users_bak/alejandro/sway/sway.nix
diff --git a/users/alejandro/sway/wallpaper.png b/users_bak/alejandro/sway/wallpaper.png
similarity index 100%
rename from users/alejandro/sway/wallpaper.png
rename to users_bak/alejandro/sway/wallpaper.png
diff --git a/users/alejandro/sway/waybar.nix b/users_bak/alejandro/sway/waybar.nix
similarity index 100%
rename from users/alejandro/sway/waybar.nix
rename to users_bak/alejandro/sway/waybar.nix
diff --git a/users/alejandro/sway/waybar_style.css b/users_bak/alejandro/sway/waybar_style.css
similarity index 100%
rename from users/alejandro/sway/waybar_style.css
rename to users_bak/alejandro/sway/waybar_style.css
diff --git a/users/alejandro/tmux.nix b/users_bak/alejandro/tmux.nix
similarity index 100%
rename from users/alejandro/tmux.nix
rename to users_bak/alejandro/tmux.nix
diff --git a/users/alejandro/vim/vim.nix b/users_bak/alejandro/vim/vim.nix
similarity index 100%
rename from users/alejandro/vim/vim.nix
rename to users_bak/alejandro/vim/vim.nix
diff --git a/users/alejandro/zsh.nix b/users_bak/alejandro/zsh.nix
similarity index 100%
rename from users/alejandro/zsh.nix
rename to users_bak/alejandro/zsh.nix