diff --git a/global.nix b/global.nix deleted file mode 100644 index 77c4385..0000000 --- a/global.nix +++ /dev/null @@ -1,148 +0,0 @@ -{ inputs, self, ... }: { - flake.nixosModules.global = { pkgs, config, lib, ... }: { - options = { - info.rootPath = lib.mkOption { - type = lib.types.str; - default = "/home/grey/nixos"; - }; - }; - - config = { - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - nix.gc = { - automatic = true; - persistent = true; - dates = "Sun 05:00"; - }; - - boot.loader.efi.canTouchEfiVariables = true; - - networking.networkmanager.enable = true; - - time.timeZone = "Europe/London"; - i18n.defaultLocale = "en_GB.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_GB.UTF-8"; - LC_IDENTIFICATION = "en_GB.UTF-8"; - LC_MEASUREMENT = "en_GB.UTF-8"; - LC_MONETARY = "en_GB.UTF-8"; - LC_NAME = "en_GB.UTF-8"; - LC_NUMERIC = "en_GB.UTF-8"; - LC_PAPER = "en_GB.UTF-8"; - LC_TELEPHONE = "en_GB.UTF-8"; - LC_TIME = "en_GB.UTF-8"; - }; - - services.xserver.xkb = { - layout = "gb"; - variant = ""; - }; - console.keyMap = "uk"; - - users.users."grey" = { - isNormalUser = true; - description = "grey"; - extraGroups = [ "networkmanager" "wheel" ]; - }; - - nixpkgs.config.allowUnfree = true; - - environment.systemPackages = with pkgs; [ - git - fzf - jq - busybox - ethtool - wayland-utils - mesa-demos - vulkan-tools - hyperfine - ]; - - fonts.packages = with pkgs; [ - iosevka-comfy.comfy - nerd-fonts.jetbrains-mono - ]; - - programs.nano = { - enable = true; - nanorc = '' - set nowrap - set tabstospaces - set tabsize 2 - ''; - }; - - hardware.bluetooth = { - enable = true; - powerOnBoot = false; - }; - - programs.gnupg.agent = { - enable = true; - }; - }; - }; - - flake.homeModules.global = { config, pkgs, ... }: { - nix.gc = { - automatic = true; - persistent = true; - dates = "Sun 05:00"; - }; - - home.packages = with pkgs; [ - bibata-cursors - x264 - speedtest-go - gparted - vlc - ]; - - programs.git = { - enable = true; - - lfs.enable = true; - - settings = { - user.name = "Grey Jones"; - user.email = "grey@greyweather.dev"; - }; - - signing = { - format = "openpgp"; - key = "CC7388DF8E1890729921BCFF7C67C51C2FF524D9"; - signByDefault = true; - }; - }; - - programs.gpg = { - enable = true; - }; - - programs.ssh = { - enable = true; - enableDefaultConfig = false; - settings = { - "git.greyweather.dev" = { - HostName = "git.greyweather.dev"; - Port = "222"; - User = "git"; - IdentityFile = "~/.ssh/id_gitea"; - }; - "github.com" = { - HostName = "github.com"; - Port = 22; - User = "git"; - IdentityFile = "~/.ssh/id_github"; - }; - }; - }; - - home.shell.enableBashIntegration = true; - }; -} \ No newline at end of file diff --git a/modules/capabilities/graphics.nix b/modules/capabilities/graphics.nix new file mode 100644 index 0000000..f9ba43a --- /dev/null +++ b/modules/capabilities/graphics.nix @@ -0,0 +1,23 @@ +{ inputs, self, ... }: { + flake.nixosModules.graphics = { config, pkgs, ... }: { + environment.systemPackages = with pkgs; [ + wayland-utils + mesa-demos + vulkan-tools + ]; + + fonts.packages = with pkgs; [ + iosevka-comfy.comfy + nerd-fonts.jetbrains-mono + ]; + }; + + flake.homeModules.graphics = { config, pkgs, ... }: { + home.packages = with pkgs; [ + bibata-cursors + x264 + gparted + vlc + ]; + }; +} \ No newline at end of file diff --git a/modules/components/shells/noctalia/noctalia.nix b/modules/components/window-managers/shells/noctalia/noctalia.nix similarity index 100% rename from modules/components/shells/noctalia/noctalia.nix rename to modules/components/window-managers/shells/noctalia/noctalia.nix diff --git a/modules/features/applications/cli/fastfetch.nix b/modules/features/applications/cli/fastfetch.nix new file mode 100644 index 0000000..ad2ab19 --- /dev/null +++ b/modules/features/applications/cli/fastfetch.nix @@ -0,0 +1,12 @@ +{ inputs, self, ... }: { + flake.nixosModules.global = { lib, config, ... }: { + options.features.applications.cli.fastfetch.enable = lib.mkEnableOption "fastfetch"; + }; + + flake.homeModules.global = { pkgs, lib, osConfig, ... }: { + config = lib.mkIf (osConfig.features.applications.cli.fastfetch.enable) ({ + programs.zsh.initContent = lib.mkOrder 1500 "fastfetch"; + programs.fastfetch.enable = true; + }); + }; +} \ No newline at end of file diff --git a/modules/programs/equibop.nix b/modules/features/applications/gui/equibop.nix similarity index 100% rename from modules/programs/equibop.nix rename to modules/features/applications/gui/equibop.nix diff --git a/modules/programs/floorp.nix b/modules/features/applications/gui/floorp.nix similarity index 100% rename from modules/programs/floorp.nix rename to modules/features/applications/gui/floorp.nix diff --git a/modules/programs/kitty.nix b/modules/features/applications/gui/kitty.nix similarity index 100% rename from modules/programs/kitty.nix rename to modules/features/applications/gui/kitty.nix diff --git a/modules/programs/nautilus.nix b/modules/features/applications/gui/nautilus.nix similarity index 100% rename from modules/programs/nautilus.nix rename to modules/features/applications/gui/nautilus.nix diff --git a/modules/programs/spotify.nix b/modules/features/applications/gui/spotify.nix similarity index 57% rename from modules/programs/spotify.nix rename to modules/features/applications/gui/spotify.nix index bd6cfd7..443ed88 100644 --- a/modules/programs/spotify.nix +++ b/modules/features/applications/gui/spotify.nix @@ -1,25 +1,25 @@ { inputs, self, ... }: { - flake.homeModules.spotify = { pkgs, config, lib, ... }: { + flake.nixosModules.graphics = { lib, ... }: { + options.features.applications.gui.spotify = { + enable = lib.mkEnableOption "spotify"; + spicetify.enable = lib.mkEnableOption "spicetify"; + }; + }; + + flake.homeModules.graphics = { pkgs, config, lib, osConfig, ... }: { imports = [ inputs.spicetify.homeManagerModules.default ]; - options = { - features.spicetify.enable = lib.mkOption { - type = lib.types.bool; - default = false; - }; - }; - config = { - home.packages = with pkgs; lib.mkIf (config.features.spicetify.enable == false) [ - spotfify - ]; + home.packages = lib.mkIf (with osConfig.features.applications.gui.spotify; enable && !spicetify.enable) (with pkgs; [ + spotify + ]); programs.spicetify = let spicePkgs = inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system}; - in lib.mkIf (config.features.spicetify.enable) { + in lib.mkIf (with osConfig.features.applications.gui.spotify; enable && spicetify.enable) { enable = true; enabledExtensions = with spicePkgs.extensions; [ hidePodcasts diff --git a/modules/programs/vscode.nix b/modules/features/applications/gui/vscode.nix similarity index 100% rename from modules/programs/vscode.nix rename to modules/features/applications/gui/vscode.nix diff --git a/modules/features/home-manager.nix b/modules/features/home-manager.nix deleted file mode 100644 index f127cec..0000000 --- a/modules/features/home-manager.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ inputs, self, ... }: { - flake.nixosModules.home-manager = { pkgs, ... }: { - imports = [ - inputs.home-manager.nixosModules.default - ]; - - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - }; - }; -} \ No newline at end of file diff --git a/modules/features/nh.nix b/modules/features/nh.nix deleted file mode 100644 index 398134a..0000000 --- a/modules/features/nh.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ inputs, self, ... }: { - flake.nixosModules.global = { pkgs, config, ... }: { - environment.systemPackages = [ - inputs.nh.packages.${pkgs.stdenv.hostPlatform.system}.default - ]; - programs.nh = { - enable = true; - flake = "/home/grey/nixos"; - }; - }; -} \ No newline at end of file diff --git a/modules/features/nixos/home-manager.nix b/modules/features/nixos/home-manager.nix new file mode 100644 index 0000000..ef8de12 --- /dev/null +++ b/modules/features/nixos/home-manager.nix @@ -0,0 +1,15 @@ +{ inputs, self, ... }: { + flake.nixosModules.global = { pkgs, lib, config, ... }: { + imports = [ + inputs.home-manager.nixosModules.default + ]; + + options.features.nixos.home-manager.enable = lib.mkEnableOption "home-manager"; + + config.home-manager = lib.mkIf (config.features.nixos.home-manager.enable) { + useGlobalPkgs = true; + useUserPackages = true; + users.grey = self.homeModules.${config.networking.hostName}; + }; + }; +} \ No newline at end of file diff --git a/modules/features/nixos/nh.nix b/modules/features/nixos/nh.nix new file mode 100644 index 0000000..1327f54 --- /dev/null +++ b/modules/features/nixos/nh.nix @@ -0,0 +1,19 @@ +{ inputs, self, ... }: { + flake.nixosModules.global = { pkgs, config, lib, ... }: { + options.features.nixos.nh.enable = lib.mkOption { + type = lib.types.bool; + default = true; + }; + + config = lib.mkIf (config.features.nixos.nh.enable) { + environment.systemPackages = [ + inputs.nh.packages.${pkgs.stdenv.hostPlatform.system}.default + ]; + + programs.nh = { + enable = true; + flake = "/home/grey/nixos"; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/features/nixos/stylix.nix b/modules/features/nixos/stylix.nix new file mode 100644 index 0000000..8703571 --- /dev/null +++ b/modules/features/nixos/stylix.nix @@ -0,0 +1,15 @@ +{ inputs, self, ... }: { + flake.nixosModules.graphics = { pkgs, lib, config, ... }: { + imports = [ + inputs.stylix.nixosModules.stylix + ]; + + options.features.nixos.stylix.enable = lib.mkEnableOption "stylix"; + + config = lib.mkIf (config.features.nixos.stylix.enable) { + stylix.enable = true; + stylix.image = builtins.path { path = "${self.outPath}/modules/hosts/${config.networking.hostName}/wallpaper.jpg"; }; + stylix.polarity = "dark"; + }; + }; +} \ No newline at end of file diff --git a/modules/features/shells/zsh.nix b/modules/features/shells/zsh.nix new file mode 100644 index 0000000..27b0a1e --- /dev/null +++ b/modules/features/shells/zsh.nix @@ -0,0 +1,38 @@ +{ inputs, self, ... }: { + flake.nixosModules.global = { config, pkgs, lib, ... }: { + options.features.shells.zsh = { + enable = lib.mkEnableOption "zsh"; + antidote.enable = lib.mkEnableOption "antidote"; + }; + + config = lib.mkIf (config.features.shells.zsh.enable) { + programs.zsh.enable = true; + users.defaultUserShell = pkgs.zsh; + users.users."grey".shell = pkgs.zsh; + }; + }; + + flake.homeModules.global = { pkgs, osConfig, lib, ... }: { + config = lib.mkIf (osConfig.features.shells.zsh.enable) { + home.shell.enableZshIntegration = true; + + programs.kitty.shellIntegration.enableZshIntegration = true; + + programs.zsh = { + enable = true; + completionInit = ""; + antidote = lib.mkIf (osConfig.features.shells.zsh.antidote.enable) { + enable = true; + plugins = [ + "getantidote/use-omz" + "ohmyzsh/ohmyzsh path:lib" + "ohmyzsh/ohmyzsh path:plugins/command-not-found" + "ohmyzsh/ohmyzsh path:themes/nanotech.zsh-theme" + "zsh-users/zsh-autosuggestions" + "zdharma-continuum/fast-syntax-highlighting" + ]; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/features/stylix.nix b/modules/features/stylix.nix deleted file mode 100644 index a06fcd1..0000000 --- a/modules/features/stylix.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ inputs, self, ... }: { - flake.nixosModules.stylix = { pkgs, ... }: { - imports = [ - inputs.stylix.nixosModules.stylix - ]; - }; -} \ No newline at end of file diff --git a/modules/global.nix b/modules/global.nix index 77c4385..7b46af6 100644 --- a/modules/global.nix +++ b/modules/global.nix @@ -57,17 +57,9 @@ jq busybox ethtool - wayland-utils - mesa-demos - vulkan-tools hyperfine ]; - fonts.packages = with pkgs; [ - iosevka-comfy.comfy - nerd-fonts.jetbrains-mono - ]; - programs.nano = { enable = true; nanorc = '' @@ -96,11 +88,7 @@ }; home.packages = with pkgs; [ - bibata-cursors - x264 speedtest-go - gparted - vlc ]; programs.git = { diff --git a/modules/hosts/graphics.nix b/modules/hosts/graphics.nix deleted file mode 100644 index e7e9ded..0000000 --- a/modules/hosts/graphics.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ inputs, self, ... }: { - # flake.nixosModules.graphics = -} \ No newline at end of file diff --git a/modules/hosts/kitagawa/home/fastfetch.nix b/modules/hosts/kitagawa/home/fastfetch.nix index 4273a72..01b8fb7 100644 --- a/modules/hosts/kitagawa/home/fastfetch.nix +++ b/modules/hosts/kitagawa/home/fastfetch.nix @@ -1,145 +1,144 @@ { inputs, self, ... }: { - flake.homeModules.kitagawa = { pkgs, lib, ... }: { - programs.zsh.initContent = lib.mkOrder 1500 "fastfetch"; - - programs.fastfetch = { - enable = true; - settings = { - logo = { - type = "builtin"; - padding = { - top = 1; - left = 2; - right = 2; + flake.homeModules.kitagawa = { pkgs, lib, osConfig, ... }: { + config = lib.mkIf (osConfig.features.applications.cli.fastfetch.enable) ({ + programs.fastfetch = { + settings = { + logo = { + type = "builtin"; + padding = { + top = 1; + left = 2; + right = 2; + }; }; - }; - modules = [ - { - type = "custom"; - format = "┌────────────────── Software ──────────────────┐"; - } - { - type = "title"; - key = " Session"; - format = "{user-name}@{host-name}"; - } - { - type = "os"; - key = " Distro"; - format = "{pretty-name}"; - } - { - type = "host"; - key = " Device"; - format = "{version}"; - } - { - type = "kernel"; - key = " Kernel"; - } - { - type = "shell"; - key = " Shell"; - } - { - type = "terminal"; - key = " Terminal"; - } - { - type = "wm"; - key = " WM"; - } - { - type = "custom"; - format = "└──────────────────────────────────────────────┘"; - } - "break" - { - type = "custom"; - format = "┌────────────────── Hardware ──────────────────┐"; - } - { - type = "cpu"; - key = " CPU"; - format = "{name}"; - } - { - type = "memory"; - key = " RAM"; - percent = { - green = 50; - yellow = 80; - type = 0; - }; - } - { - type = "swap"; - key = " Swap"; - percent = { - green = 50; - yellow = 80; - type = 0; - }; - separate = false; - } - { - type = "disk"; - key = " Disk"; - showRegular = true; - showExternal = false; - showHidden = false; - showSubvolumes = false; - showReadOnly = true; - ShowUnknown = false; - hideFolders = "/efi:/boot:/boot/*:/run/media/*"; - useAvailable = false; - percent = { - green = 50; - yellow = 80; - type = 0; - }; - } - { - type = "localip"; - key = " IP"; - showIpv4 = true; - showIpv6 = false; - showMac = false; - showLoop = false; - showPrefixLen = true; - showMtu = false; - showSpeed = false; - showFlags = false; - compact = false; - defaultRouteOnly = true; - showAllIps = false; - } - { - type = "custom"; - format = "└──────────────────────────────────────────────┘"; - } - "break" - { - type = "custom"; - format = "┌──────────────── Age + Uptime ────────────────┐"; - } - { - type = "disk"; - key = " OS Age"; - folders = "/"; - format = "{create-time:10} ({days} days)"; - } - { - type = "uptime"; - key = " Uptime"; - } - { - type = "custom"; - format = "└──────────────────────────────────────────────┘"; - } - ]; + modules = [ + { + type = "custom"; + format = "┌────────────────── Software ──────────────────┐"; + } + { + type = "title"; + key = " Session"; + format = "{user-name}@{host-name}"; + } + { + type = "os"; + key = " Distro"; + format = "{pretty-name}"; + } + { + type = "host"; + key = " Device"; + format = "{version}"; + } + { + type = "kernel"; + key = " Kernel"; + } + { + type = "shell"; + key = " Shell"; + } + { + type = "terminal"; + key = " Terminal"; + } + { + type = "wm"; + key = " WM"; + } + { + type = "custom"; + format = "└──────────────────────────────────────────────┘"; + } + "break" + { + type = "custom"; + format = "┌────────────────── Hardware ──────────────────┐"; + } + { + type = "cpu"; + key = " CPU"; + format = "{name}"; + } + { + type = "memory"; + key = " RAM"; + percent = { + green = 50; + yellow = 80; + type = 0; + }; + } + { + type = "swap"; + key = " Swap"; + percent = { + green = 50; + yellow = 80; + type = 0; + }; + separate = false; + } + { + type = "disk"; + key = " Disk"; + showRegular = true; + showExternal = false; + showHidden = false; + showSubvolumes = false; + showReadOnly = true; + ShowUnknown = false; + hideFolders = "/efi:/boot:/boot/*:/run/media/*"; + useAvailable = false; + percent = { + green = 50; + yellow = 80; + type = 0; + }; + } + { + type = "localip"; + key = " IP"; + showIpv4 = true; + showIpv6 = false; + showMac = false; + showLoop = false; + showPrefixLen = true; + showMtu = false; + showSpeed = false; + showFlags = false; + compact = false; + defaultRouteOnly = true; + showAllIps = false; + } + { + type = "custom"; + format = "└──────────────────────────────────────────────┘"; + } + "break" + { + type = "custom"; + format = "┌──────────────── Age + Uptime ────────────────┐"; + } + { + type = "disk"; + key = " OS Age"; + folders = "/"; + format = "{create-time:10} ({days} days)"; + } + { + type = "uptime"; + key = " Uptime"; + } + { + type = "custom"; + format = "└──────────────────────────────────────────────┘"; + } + ]; + }; }; - }; + }); }; } \ No newline at end of file diff --git a/modules/hosts/kitagawa/kitagawa.nix b/modules/hosts/kitagawa/kitagawa.nix index 3cdc3d3..5477270 100644 --- a/modules/hosts/kitagawa/kitagawa.nix +++ b/modules/hosts/kitagawa/kitagawa.nix @@ -1,7 +1,9 @@ { inputs, self, ... }: { flake.nixosConfigurations.kitagawa = inputs.nixpkgs.lib.nixosSystem { - modules = [ - self.nixosModules.kitagawa + modules = with self.nixosModules; [ + global + graphics + kitagawa ]; }; @@ -11,15 +13,36 @@ networking.hostName = "kitagawa"; imports = with self.nixosModules; [ - global - home-manager - stylix ly niri noctalia - zsh ]; + features = { + nixos = { + home-manager.enable = true; + stylix.enable = true; + }; + + shells.zsh = { + enable = true; + antidote.enable = true; + }; + + applications = { + cli = { + fastfetch.enable = true; + }; + + gui = { + spotify = { + enable = true; + spicetify.enable = true; + }; + }; + }; + }; + nix.buildMachines = [ { hostName = "nixremote"; @@ -63,12 +86,6 @@ maxGenerations = 10; }; }; - - stylix.enable = true; - stylix.image = ./wallpaper.jpg; - stylix.polarity = "dark"; - - home-manager.users.grey = self.homeModules.kitagawa; }; flake.homeModules.kitagawa = { config, pkgs, inputs, lib, ... }: { @@ -76,18 +93,15 @@ imports = with self.homeModules; [ global + graphics niri noctalia vscode kitty - zsh floorp equibop - spotify ]; - features.spicetify.enable = true; - /* imports = [ #"${global-configs}/gnome.nix" diff --git a/modules/features/flake-parts.nix b/modules/meta/flake-parts.nix similarity index 100% rename from modules/features/flake-parts.nix rename to modules/meta/flake-parts.nix diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix deleted file mode 100644 index 312f097..0000000 --- a/modules/programs/zsh.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ inputs, self, ... }: { - flake.nixosModules.zsh = { config, pkgs, ... }: { - programs.zsh.enable = true; - users.defaultUserShell = pkgs.zsh; - users.users."grey".shell = pkgs.zsh; - }; - - flake.homeModules.zsh = { pkgs, ... }: { - home.shell.enableZshIntegration = true; - - programs.kitty.shellIntegration.enableZshIntegration = true; - - programs.zsh = { - enable = true; - completionInit = ""; - antidote = { - enable = true; - plugins = [ - "getantidote/use-omz" - "ohmyzsh/ohmyzsh path:lib" - "ohmyzsh/ohmyzsh path:plugins/command-not-found" - "ohmyzsh/ohmyzsh path:themes/nanotech.zsh-theme" - "zsh-users/zsh-autosuggestions" - "zdharma-continuum/fast-syntax-highlighting" - ]; - }; - }; - }; -} \ No newline at end of file