diff --git a/hive.nix b/hive.nix new file mode 100644 index 0000000..1cfac3d --- /dev/null +++ b/hive.nix @@ -0,0 +1,18 @@ +{ + meta.nixpkgs = ; + defaults = { pkgs, ... }: { + imports = [ + (import ) + ./modules + ]; + boot.tmp.useTmpfs = true; + }; + kat-probook = { name, nodes, ... }: { + imports = [ + ./machines/kat-probook/configuration.nix + ./users/home_manager.nix + ]; + deployment.allowLocalDeployment = true; + networking.hostName = name; + }; +} diff --git a/configuration.nix b/machines/kat-probook/configuration.nix similarity index 90% rename from configuration.nix rename to machines/kat-probook/configuration.nix index 94fdb37..1cf930e 100644 --- a/configuration.nix +++ b/machines/kat-probook/configuration.nix @@ -1,35 +1,25 @@ # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, mods, ... }: { imports = [ ./hardware-configuration.nix - ./home_manager.nix - (import ) ]; - boot.tmp.useTmpfs = true; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; boot.supportedFilesystems = [ "bcachefs" ]; boot.kernelPackages = pkgs.linuxPackages_latest; - networking.hostName = "katvayor"; # Define your hostname. networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. time.timeZone = "Europe/Paris"; - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; console = { font = "Lat2-Terminus16"; keyMap = "fr"; - # useXkbConfig = true; # use xkb.options in tty. }; # Enable the X11 windowing system. @@ -126,7 +116,7 @@ # }; home-manager.users.root = { home.stateVersion = "23.11"; - imports = [ ./neovim ./zsh.nix ]; + imports = [ "${mods}/neovim" "${mods}/zsh.nix" ]; }; services.syncthing = { diff --git a/hardware-configuration.nix b/machines/kat-probook/hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to machines/kat-probook/hardware-configuration.nix diff --git a/alacritty.toml b/modules/alacritty.toml similarity index 100% rename from alacritty.toml rename to modules/alacritty.toml diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..568f859 --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,3 @@ +{ ... }: { + config._module.args = { mods = ./.; }; +} diff --git a/neovim/default.nix b/modules/neovim/default.nix similarity index 100% rename from neovim/default.nix rename to modules/neovim/default.nix diff --git a/neovim/nvim.lua b/modules/neovim/nvim.lua similarity index 100% rename from neovim/nvim.lua rename to modules/neovim/nvim.lua diff --git a/neovim/nvimrc b/modules/neovim/nvimrc similarity index 100% rename from neovim/nvimrc rename to modules/neovim/nvimrc diff --git a/wall.jpg b/modules/wall.jpg similarity index 100% rename from wall.jpg rename to modules/wall.jpg diff --git a/waybar/config b/modules/waybar/config similarity index 100% rename from waybar/config rename to modules/waybar/config diff --git a/waybar/style.css b/modules/waybar/style.css similarity index 100% rename from waybar/style.css rename to modules/waybar/style.css diff --git a/weenotify.py b/modules/weenotify.py similarity index 100% rename from weenotify.py rename to modules/weenotify.py diff --git a/zsh.nix b/modules/zsh.nix similarity index 100% rename from zsh.nix rename to modules/zsh.nix diff --git a/home_manager.nix b/users/home_manager.nix similarity index 95% rename from home_manager.nix rename to users/home_manager.nix index 9b96844..1b838dc 100644 --- a/home_manager.nix +++ b/users/home_manager.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, mods, ... }: { imports = [ (import ) @@ -6,7 +6,7 @@ home-manager.users.catvayor = { home.stateVersion = "23.11"; - imports = [ ./neovim ./zsh.nix ]; + imports = [ "${mods}/neovim" "${mods}/zsh.nix" ]; xdg.configFile."sway/config".onChange = lib.mkForce ""; @@ -37,8 +37,8 @@ programs.thunderbird.enable = true; programs.thunderbird.profiles = {}; programs.waybar.enable = true; - home.file.".config/waybar" = { source = ./waybar; recursive = true; }; - programs.alacritty = { enable = true; settings = lib.importTOML ./alacritty.toml; }; + home.file.".config/waybar" = { source = "${mods}/waybar"; recursive = true; }; + programs.alacritty = { enable = true; settings = lib.importTOML "${mods}/alacritty.toml"; }; services.mako = { enable = true; width = 400; @@ -60,7 +60,7 @@ xdg.enable = true; services.swayidle = - let lockwall = pkgs.runCommand "lock_wall.jpg" {} ''${pkgs.ffmpeg}/bin/ffmpeg -i ${./wall.jpg} -filter_complex 'gblur=sigma=3' $out -y''; + let lockwall = pkgs.runCommand "lock_wall.jpg" {} ''${pkgs.ffmpeg}/bin/ffmpeg -i ${"${mods}/wall.jpg"} -filter_complex 'gblur=sigma=3' $out -y''; in { enable = true; timeouts = [ @@ -87,7 +87,7 @@ let menuCmd = "${pkgs.wofi}/bin/wofi --show drun -i | xargs swaymsg exec --"; exitMd = ''Exit Mode:| (l)Log out | (r)Reboot | (p)Poweroff''; weechatCmd = pkgs.writeShellScript "weechat.sh" '' - nix-shell -p python3 python311Packages.dbus-python python311Packages.notify2 --run 'python ${./weenotify.py} -s' > /dev/null & + nix-shell -p python3 python311Packages.dbus-python python311Packages.notify2 --run 'python ${"${mods}/weenotify.py"} -s' > /dev/null & while true; do ssh -R 5431:localhost:5431 weecat@watcher.kat -t screen -xaA -S weechat sleep 1 @@ -123,7 +123,7 @@ command = "waybar"; mode = "hide"; }]; - output."*".bg = "${./wall.jpg} fill"; + output."*".bg = "${"${mods}/wall.jpg"} fill"; seat."*"."hide_cursor" = "5000"; focus.wrapping = "yes"; window.titlebar = false;