mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 09:27:44 -04:00
Merge pull request #322 from genebean/passing-variables-around
Pass hostname and username to modules
This commit is contained in:
commit
ce3edc74b5
6 changed files with 43 additions and 41 deletions
32
flake.lock
generated
32
flake.lock
generated
|
|
@ -3,16 +3,16 @@
|
||||||
"brew-src": {
|
"brew-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1690184446,
|
"lastModified": 1694443293,
|
||||||
"narHash": "sha256-fGjvNY6ON/cdExCfwhfqmHzoxs3AZ0sev7vyBHfPGJo=",
|
"narHash": "sha256-wBjbF2RRFyD4lN7ie98VnggmNBwAPv/dg2U+w5mUyuM=",
|
||||||
"owner": "Homebrew",
|
"owner": "Homebrew",
|
||||||
"repo": "brew",
|
"repo": "brew",
|
||||||
"rev": "3b3300546b5a4e40b74f4ee33cf225cca280defe",
|
"rev": "4afb8e5602f3ecc9edf67a44257d8eceeaa8a108",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "Homebrew",
|
"owner": "Homebrew",
|
||||||
"ref": "4.1.1",
|
"ref": "4.1.11",
|
||||||
"repo": "brew",
|
"repo": "brew",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
@ -78,11 +78,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1694375657,
|
"lastModified": 1702735279,
|
||||||
"narHash": "sha256-32X8dcty4vPXx+D4yJPQZBo5hJ1NQikALhevGv6elO4=",
|
"narHash": "sha256-SztEzDOE/6bDNnWWvnRbSHPVrgewLwdSei1sxoZFejM=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "f7848d3e5f15ed02e3f286029697e41ee31662d7",
|
"rev": "e9b9ecef4295a835ab073814f100498716b05a96",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -98,11 +98,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1694497842,
|
"lastModified": 1700795494,
|
||||||
"narHash": "sha256-z03v/m0OwcLBok97KcUgMl8ZFw5Xwsi2z+n6nL7JdXY=",
|
"narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=",
|
||||||
"owner": "lnl7",
|
"owner": "lnl7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "4496ab26628c5f43d2a5c577a06683c753e32fe2",
|
"rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -137,11 +137,11 @@
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1690495710,
|
"lastModified": 1695057498,
|
||||||
"narHash": "sha256-7yF5A16Ayorrpcal74mRB1EqwUAHfXnoCIgDvj+ylgo=",
|
"narHash": "sha256-wn3j7u5tOgLLbNxZC542rJiP5iX323m+CoGPMgPOxp4=",
|
||||||
"owner": "zhaofengli-wip",
|
"owner": "zhaofengli-wip",
|
||||||
"repo": "nix-homebrew",
|
"repo": "nix-homebrew",
|
||||||
"rev": "d2738b78fd0f304f5a7ed4764b736ed2c7169b94",
|
"rev": "6ab33c5e9249e74401144a7c667d96a757c5d341",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -197,11 +197,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1694459622,
|
"lastModified": 1702735365,
|
||||||
"narHash": "sha256-PcbBuRJKFxgb+CUQ3sliI5oRaKHHAV+OSTv6GPAccEA=",
|
"narHash": "sha256-PqGFt/SH8WHzuvlgRHrvRjYrafGV7A2S1mfAMnLNol8=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "bb446a19f77e8d1d0c5ada7069d21a001442fc73",
|
"rev": "db6ce8b1a2735932a19575958c1be4b3b62662df",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
12
flake.nix
12
flake.nix
|
|
@ -38,16 +38,17 @@
|
||||||
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 = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
permittedInsecurePackages = [
|
permittedInsecurePackages = [
|
||||||
"python-2.7.18.6"
|
"python-2.7.18.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";
|
||||||
|
|
@ -93,4 +93,4 @@ in {
|
||||||
home = "/Users/${username}";
|
home = "/Users/${username}";
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
@ -46,4 +49,4 @@
|
||||||
time.timeZone = "America/New_York";
|
time.timeZone = "America/New_York";
|
||||||
|
|
||||||
users.defaultUserShell = pkgs.zsh;
|
users.defaultUserShell = pkgs.zsh;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,12 +45,15 @@
|
||||||
theme = "Catppuccin-frappe";
|
theme = "Catppuccin-frappe";
|
||||||
};
|
};
|
||||||
themes = {
|
themes = {
|
||||||
Catppuccin-frappe = builtins.readFile (pkgs.fetchFromGitHub {
|
Catppuccin-frappe = {
|
||||||
owner = "catppuccin";
|
src = pkgs.fetchFromGitHub {
|
||||||
repo = "bat";
|
owner = "catppuccin";
|
||||||
rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1";
|
repo = "bat";
|
||||||
hash = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw=";
|
rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1";
|
||||||
} + "/Catppuccin-frappe.tmTheme");
|
hash = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw=";
|
||||||
|
};
|
||||||
|
file = "Catppuccin-frappe.tmTheme";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
eza.enable = true;
|
eza.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -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