mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 09:27:44 -04:00
Pass hostname and username to modules
This commit is contained in:
parent
65efd22cb3
commit
70c2dc4e2f
4 changed files with 17 additions and 18 deletions
10
flake.nix
10
flake.nix
|
|
@ -38,7 +38,7 @@
|
||||||
inputs = { inherit disko home-manager nixpkgs nixpkgs-unstable nix-darwin; };
|
inputs = { inherit disko home-manager nixpkgs nixpkgs-unstable nix-darwin; };
|
||||||
|
|
||||||
# creates a macOS system config
|
# creates a macOS system config
|
||||||
darwinSystem = system: hostName: username: nix-darwin.lib.darwinSystem {
|
darwinSystem = system: hostname: username: nix-darwin.lib.darwinSystem {
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config = {
|
config = {
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
specialArgs = { inherit inputs username hostname; };
|
||||||
modules = [
|
modules = [
|
||||||
nix-homebrew.darwinModules.nix-homebrew
|
nix-homebrew.darwinModules.nix-homebrew
|
||||||
{
|
{
|
||||||
|
|
@ -77,12 +78,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
./modules/common/darwin/all-hosts.nix
|
./modules/common/darwin/all-hosts.nix
|
||||||
./modules/hosts/darwin/${hostName} # ip address, host specific stuff
|
./modules/hosts/darwin/${hostname} # ip address, host specific stuff
|
||||||
]; # end modules
|
]; # end modules
|
||||||
}; # end darwinSystem
|
}; # end darwinSystem
|
||||||
|
|
||||||
# creates a nixos system config
|
# creates a nixos system config
|
||||||
nixosSystem = system: hostName: username: nixpkgs.lib.nixosSystem {
|
nixosSystem = system: hostname: username: nixpkgs.lib.nixosSystem {
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config = {
|
config = {
|
||||||
|
|
@ -92,6 +93,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
specialArgs = { inherit inputs username hostname; };
|
||||||
modules = [
|
modules = [
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
|
|
@ -107,7 +109,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
./modules/common/nixos/all-hosts.nix
|
./modules/common/nixos/all-hosts.nix
|
||||||
./modules/hosts/nixos/${hostName} # ip address, host specific stuff
|
./modules/hosts/nixos/${hostname} # ip address, host specific stuff
|
||||||
];
|
];
|
||||||
}; # end nixosSystem
|
}; # end nixosSystem
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
{ pkgs, ... }: let
|
{ pkgs, hostname, username, ... }: {
|
||||||
username = "gene.liverman";
|
|
||||||
in {
|
|
||||||
environment = {
|
environment = {
|
||||||
shells = with pkgs; [ bash zsh ];
|
shells = with pkgs; [ bash zsh ];
|
||||||
loginShell = pkgs.zsh;
|
loginShell = pkgs.zsh;
|
||||||
|
|
@ -68,6 +66,8 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
networking.hostName = "${hostname}";
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
settings = {
|
settings = {
|
||||||
bash-prompt-prefix = "(nix:$name)\040";
|
bash-prompt-prefix = "(nix:$name)\040";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, hostname, username, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./internationalisation.nix
|
./internationalisation.nix
|
||||||
];
|
];
|
||||||
|
|
@ -26,7 +26,10 @@
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
networking.hostName = "${hostname}";
|
||||||
|
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
|
allowed-users = [ "${username}" ];
|
||||||
experimental-features = [
|
experimental-features = [
|
||||||
"flakes"
|
"flakes"
|
||||||
"nix-command"
|
"nix-command"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
{ config, pkgs, ... }: let
|
{ config, pkgs, username, ... }: {
|
||||||
username = "gene";
|
|
||||||
hostname = "rainbow-planet";
|
|
||||||
in {
|
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
@ -39,12 +36,9 @@ in {
|
||||||
];
|
];
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "${hostname}";
|
|
||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
nix.settings.allowed-users = [ "${username}" ];
|
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
_1password.enable = true;
|
_1password.enable = true;
|
||||||
_1password-gui = {
|
_1password-gui = {
|
||||||
|
|
@ -104,7 +98,7 @@ in {
|
||||||
description = "Gene Liverman";
|
description = "Gene Liverman";
|
||||||
extraGroups = [ "networkmanager" "wheel" "dialout" "input" ];
|
extraGroups = [ "networkmanager" "wheel" "dialout" "input" ];
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
tailscale-systray
|
tailscale-systray
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue