diff --git a/flake.nix b/flake.nix index ed34e1c..90ecd9d 100644 --- a/flake.nix +++ b/flake.nix @@ -12,12 +12,10 @@ }; }; - outputs = - inputs @ { self, nixpkgs, nixpkgs-unstable, home-manager, colmena, ... }: + outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, home-manager, colmena, ... }: let inherit (self) outputs; systems = [ "aarch64-linux" "i686-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ]; - forEachSystem = f: lib.genAttrs systems (system: f); forAllSystems = lib.genAttrs systems; lib = nixpkgs.lib // home-manager.lib; in @@ -26,8 +24,7 @@ formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixpkgs-fmt); devShells = forAllSystems (system: - let pkgs = import nixpkgs { system = system; }; in - { + let pkgs = import nixpkgs { system = system; }; in { default = pkgs.mkShell { nativeBuildInputs = [ pkgs.nix pkgs.colmena pkgs.git pkgs.home-manager pkgs.nixos-rebuild ]; shellHook = "exec $SHELL"; @@ -69,6 +66,7 @@ modules = [ ./modules/nixos/common.nix ./hosts/test-vm/configuration.nix (import "${home-manager}/nixos") ]; }; } // colmenaHive.nodes; + homeConfigurations.sammy = let pkgs = import nixpkgs { system = "x86_64-linux"; }; diff --git a/hosts/bengal/configuration.nix b/hosts/bengal/configuration.nix index e894862..f731df4 100644 --- a/hosts/bengal/configuration.nix +++ b/hosts/bengal/configuration.nix @@ -1,13 +1,5 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page, on -# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ config -, lib -, pkgs -, ... -}: { +{ ... }: { imports = [ - # Include the results of the hardware scan. ./hardware-configuration.nix ]; diff --git a/hosts/bengal/hardware-configuration.nix b/hosts/bengal/hardware-configuration.nix index 19c2716..47aa8f2 100644 --- a/hosts/bengal/hardware-configuration.nix +++ b/hosts/bengal/hardware-configuration.nix @@ -1,12 +1,4 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config -, lib -, pkgs -, modulesPath -, ... -}: { +{ config, lib, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; diff --git a/hosts/maine-coon/configuration.nix b/hosts/maine-coon/configuration.nix index d3af4b5..34da00a 100644 --- a/hosts/maine-coon/configuration.nix +++ b/hosts/maine-coon/configuration.nix @@ -1,10 +1,5 @@ -{ config -, pkgs -, lib -, ... -}: { +{ ... }: { imports = [ - # Include the results of the hardware scan. ./hardware-configuration.nix ]; @@ -32,9 +27,6 @@ }; networking.nameservers = [ "8.8.8.8" ]; - # Initial empty root password for easy login: - services.openssh.permitRootLogin = lib.mkForce "prohibit-password"; - users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJZyQSZw+pExsx2RXB+yxbaJGB9mtvudbQ/BP7E1yKvr openpgp:0x6068FEBB" ]; diff --git a/hosts/maine-coon/hardware-configuration.nix b/hosts/maine-coon/hardware-configuration.nix index 40d34c4..f0200c6 100644 --- a/hosts/maine-coon/hardware-configuration.nix +++ b/hosts/maine-coon/hardware-configuration.nix @@ -1,11 +1,4 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config -, lib -, pkgs -, ... -}: { +{ ... }: { boot.initrd.availableKernelModules = [ "ahci" "nvme" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; diff --git a/hosts/test-vm/configuration.nix b/hosts/test-vm/configuration.nix index afda8fc..18febbd 100644 --- a/hosts/test-vm/configuration.nix +++ b/hosts/test-vm/configuration.nix @@ -1,26 +1,4 @@ -{ config -, lib -, pkgs -, ... -}: { - users.users.admin = { - isNormalUser = true; - extraGroups = [ "wheel" ]; - password = "admin"; - group = "admin"; - }; - - users.groups.admin = { }; - - virtualisation.vmVariant = { - # following configuration is added only when building VM with build-vm - virtualisation = { - memorySize = 8192; - cores = 6; - graphics = true; - }; - }; - +{ lib, pkgs, ... }: { services.openssh = { enable = true; settings.PasswordAuthentication = lib.mkForce true; diff --git a/misc/module-template.nix b/misc/module-template.nix index 855efa5..89b295a 100644 --- a/misc/module-template.nix +++ b/misc/module-template.nix @@ -1,12 +1,4 @@ -{ pkgs -, config -, lib -, ... -}: -let - cfg = config.cherrykitten; -in -{ +{ ... }: { options.cherrykitten = { }; config = { }; diff --git a/modules/home/default.nix b/modules/home/default.nix index 37de01e..8d6af84 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,35 +1,9 @@ -{ pkgs, ... }: { - imports = [ ./fish ./nvim ./tmux.nix ./starship.nix ]; - home.packages = with pkgs; [ - bat - lsd - gnupg - colmena +{ ... }: { + imports = [ + ./fish + ./nvim + ./tmux.nix + ./starship.nix + ./git.nix ]; - - programs = { - home-manager.enable = true; - - git = { - enable = true; - extraConfig = { - init = { defaultBranch = "main"; }; - core = { editor = "nvim"; }; - pull.rebase = true; - }; - aliases = { - a = "add"; - ai = "add -p"; - br = "branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate"; - c = "commit"; - del = "branch -D"; - p = "push"; - pf = "push --force-with-lease"; - r = "rebase"; - ri = "rebase -i"; - s = "status"; - sw = "switch"; - }; - }; - }; } diff --git a/modules/home/fish/default.nix b/modules/home/fish/default.nix index d3a2521..7b1032d 100644 --- a/modules/home/fish/default.nix +++ b/modules/home/fish/default.nix @@ -11,8 +11,8 @@ ''; shellAliases = { - g = "git"; - }; + g = "git"; + }; }; diff --git a/modules/home/git.nix b/modules/home/git.nix new file mode 100644 index 0000000..5daa2ec --- /dev/null +++ b/modules/home/git.nix @@ -0,0 +1,23 @@ +{ ... }: { + programs.git = { + enable = true; + extraConfig = { + init = { defaultBranch = "main"; }; + core = { editor = "nvim"; }; + pull.rebase = true; + }; + aliases = { + a = "add"; + ai = "add -p"; + br = "branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate"; + c = "commit"; + del = "branch -D"; + p = "push"; + pf = "push --force-with-lease"; + r = "rebase"; + ri = "rebase -i"; + s = "status"; + sw = "switch"; + }; + }; +} diff --git a/modules/home/nvim/default.nix b/modules/home/nvim/default.nix index 4dfc46d..252038a 100644 --- a/modules/home/nvim/default.nix +++ b/modules/home/nvim/default.nix @@ -1,6 +1,4 @@ -{ config, lib, pkgs, pkgs-unstable, ... }: - -{ +{ lib, pkgs, pkgs-unstable, ... }: { programs.neovim = { enable = true; package = pkgs-unstable.neovim-unwrapped; @@ -22,7 +20,6 @@ extraLuaConfig = let plugins = with pkgs.vimPlugins; [ - # LazyVim LazyVim bufferline-nvim cmp-buffer diff --git a/modules/home/starship.nix b/modules/home/starship.nix index e89ce9c..54620bb 100644 --- a/modules/home/starship.nix +++ b/modules/home/starship.nix @@ -1,5 +1,4 @@ -{ config, pkgs, lib, ... }: -{ +{ lib, ... }: { programs.starship = { enable = true; settings = { diff --git a/modules/home/tmux.nix b/modules/home/tmux.nix index b61acb4..e577cfe 100644 --- a/modules/home/tmux.nix +++ b/modules/home/tmux.nix @@ -1,5 +1,4 @@ -{ pkgs, config, lib, ... }: { - +{ ... }: { programs.tmux = { enable = true; @@ -25,6 +24,6 @@ set-option -sa terminal-features ',kitty:RGB' ''; - }; - } + }; +} diff --git a/modules/nixos/common.nix b/modules/nixos/common.nix index f19352a..5ebcaa3 100644 --- a/modules/nixos/common.nix +++ b/modules/nixos/common.nix @@ -1,12 +1,4 @@ -{ lib -, config -, pkgs -, ... -}: -let - cfg = config.cherrykitten.common; -in -{ +{ lib, pkgs, ... }: { options.cherrykitten.common = { test = lib.mkOption { type = lib.types.str; diff --git a/modules/nixos/graphical.nix b/modules/nixos/graphical.nix index fba13a1..cd5a986 100644 --- a/modules/nixos/graphical.nix +++ b/modules/nixos/graphical.nix @@ -1,8 +1,4 @@ -{ pkgs -, config -, lib -, ... -}: +{ config, lib, ... }: let cfg = config.cherrykitten.graphical; in diff --git a/modules/nixos/security.nix b/modules/nixos/security.nix index 19f19e0..6fbc1b5 100644 --- a/modules/nixos/security.nix +++ b/modules/nixos/security.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ ... }: { networking.firewall.allowedTCPPorts = [ 22 ]; services.openssh = { diff --git a/modules/nixos/virtualization.nix b/modules/nixos/virtualization.nix index 86fd809..7c61906 100644 --- a/modules/nixos/virtualization.nix +++ b/modules/nixos/virtualization.nix @@ -1,5 +1,4 @@ -{ config, pkgs, lib, ... }: -{ +{ ... }: { virtualisation.vmVariant = { # following configuration is added only when building VM with build-vm virtualisation = { diff --git a/modules/users/default.nix b/modules/users/default.nix index e486207..1aab895 100644 --- a/modules/users/default.nix +++ b/modules/users/default.nix @@ -1,8 +1,4 @@ -{ pkgs -, config -, lib -, ... -}: +{ pkgs, config, lib, ... }: let cfg = config.cherrykitten.users; in