mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-01-11 20:40:24 +01:00
refactor: Use haumea for filesystem-based module system for flake outputs
refactor: Use hyphen(`-`) for variable names & folder names(except Python), replace all unserscore(`_`) with hyphen(`-`).
This commit is contained in:
@@ -1,20 +1,23 @@
|
||||
# colmena - Remote Deployment via SSH
|
||||
{
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
specialArgs,
|
||||
inputs,
|
||||
nixos-modules,
|
||||
home-module ? null,
|
||||
host_tags,
|
||||
targetUser ? specialArgs.username,
|
||||
myvars,
|
||||
system,
|
||||
tags,
|
||||
ssh-user,
|
||||
genSpecialArgs,
|
||||
...
|
||||
}: let
|
||||
inherit (specialArgs) username;
|
||||
inherit (inputs) home-manager;
|
||||
specialArgs = genSpecialArgs system;
|
||||
in
|
||||
{name, ...}: {
|
||||
deployment = {
|
||||
inherit targetUser;
|
||||
targetHost = builtins.replaceStrings ["_"] ["-"] name; # hostName or IP address
|
||||
tags = host_tags;
|
||||
inherit tags;
|
||||
targetUser = ssh-user;
|
||||
targetHost = name; # hostName or IP address
|
||||
};
|
||||
|
||||
imports =
|
||||
@@ -28,7 +31,7 @@ in
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
home-manager.extraSpecialArgs = specialArgs;
|
||||
home-manager.users."${username}" = home-module;
|
||||
home-manager.users."${myvars.username}" = home-module;
|
||||
}
|
||||
]
|
||||
else []
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
macosSystem = import ./macosSystem.nix;
|
||||
nixosSystem = import ./nixosSystem.nix;
|
||||
attrs = import ./attrs.nix {inherit lib;};
|
||||
# use path relative to the root of the project
|
||||
relativeToRoot = lib.path.append ../.;
|
||||
scanPaths = path:
|
||||
builtins.map
|
||||
(f: (path + "/${f}"))
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
{
|
||||
nixpkgs,
|
||||
nix-darwin,
|
||||
home-manager,
|
||||
system,
|
||||
specialArgs,
|
||||
inputs,
|
||||
darwin-modules,
|
||||
home-module,
|
||||
home-module ? null,
|
||||
myvars,
|
||||
system,
|
||||
genSpecialArgs,
|
||||
...
|
||||
}: let
|
||||
inherit (specialArgs) username;
|
||||
inherit (inputs) nixpkgs home-manager nix-darwin;
|
||||
specialArgs = genSpecialArgs system;
|
||||
in
|
||||
nix-darwin.lib.darwinSystem {
|
||||
inherit system specialArgs;
|
||||
@@ -31,7 +32,7 @@ in
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
home-manager.extraSpecialArgs = specialArgs;
|
||||
home-manager.users."${username}" = home-module;
|
||||
home-manager.users."${myvars.username}" = home-module;
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
{
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
nixos-generators,
|
||||
inputs,
|
||||
lib,
|
||||
system,
|
||||
specialArgs,
|
||||
genSpecialArgs,
|
||||
nixos-modules,
|
||||
home-module ? null,
|
||||
myvars,
|
||||
...
|
||||
}: let
|
||||
inherit (specialArgs) username;
|
||||
inherit (inputs) nixpkgs home-manager nixos-generators;
|
||||
specialArgs = genSpecialArgs system;
|
||||
in
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit system specialArgs;
|
||||
@@ -24,17 +26,16 @@ in
|
||||
}
|
||||
]
|
||||
++ (
|
||||
if (home-module != null)
|
||||
then [
|
||||
lib.optionals (home-module != null)
|
||||
[
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
home-manager.extraSpecialArgs = specialArgs;
|
||||
home-manager.users."${username}" = home-module;
|
||||
home-manager.users."${myvars.username}" = home-module;
|
||||
}
|
||||
]
|
||||
else []
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user