mirror of
https://github.com/starr-dusT/dotfiles.git
synced 2025-02-19 19:27:31 -08:00
Merge branch 'master' of github.com:starr-dusT/dotfiles
the commit.
This commit is contained in:
commit
396d73cc54
@ -15,34 +15,18 @@
|
|||||||
outputs = inputs @ { self, nixpkgs, home-manager, jovian-nixos, agenix, nixos-wsl, ... }:
|
outputs = inputs @ { self, nixpkgs, home-manager, jovian-nixos, agenix, nixos-wsl, ... }:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
user = "tstarr";
|
hosts = builtins.fromJSON (builtins.readFile ./hosts.json);
|
||||||
lib = nixpkgs.lib;
|
lib = nixpkgs.lib;
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = {
|
nixosConfigurations = lib.mapAttrs (hostname: hostConfig:
|
||||||
kestrel = lib.nixosSystem (import ./hosts/kestrel {
|
lib.nixosSystem (import ./hosts/${hostConfig.role} {
|
||||||
inherit lib;
|
inherit lib;
|
||||||
inherit system user inputs agenix home-manager;
|
inherit system inputs agenix home-manager jovian-nixos nixos-wsl;
|
||||||
});
|
specialArgs = {
|
||||||
shivan = lib.nixosSystem (import ./hosts/shivan {
|
user = hostConfig.user;
|
||||||
inherit lib;
|
hostname = "${hostname}";
|
||||||
inherit system user inputs agenix home-manager;
|
};
|
||||||
});
|
})
|
||||||
torus = lib.nixosSystem (import ./hosts/torus {
|
) hosts;
|
||||||
inherit lib;
|
|
||||||
inherit system user inputs agenix home-manager;
|
|
||||||
});
|
|
||||||
bulwark = lib.nixosSystem (import ./hosts/bulwark {
|
|
||||||
inherit lib;
|
|
||||||
inherit system user inputs agenix home-manager jovian-nixos;
|
|
||||||
});
|
|
||||||
wsl = lib.nixosSystem (import ./hosts/wsl {
|
|
||||||
inherit lib;
|
|
||||||
inherit system user inputs agenix home-manager nixos-wsl;
|
|
||||||
});
|
|
||||||
osprey = lib.nixosSystem (import ./hosts/osprey {
|
|
||||||
inherit lib;
|
|
||||||
inherit system user inputs agenix home-manager;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
30
provision/hosts.json
Normal file
30
provision/hosts.json
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"kestrel": {
|
||||||
|
"role": "kestrel",
|
||||||
|
"user": "tstarr"
|
||||||
|
},
|
||||||
|
"shivan": {
|
||||||
|
"role": "shivan",
|
||||||
|
"user": "tstarr"
|
||||||
|
},
|
||||||
|
"torus": {
|
||||||
|
"role": "torus",
|
||||||
|
"user": "tstarr"
|
||||||
|
},
|
||||||
|
"bulwark": {
|
||||||
|
"role": "bulwark",
|
||||||
|
"user": "tstarr"
|
||||||
|
},
|
||||||
|
"osprey": {
|
||||||
|
"role": "osprey",
|
||||||
|
"user": "tstarr"
|
||||||
|
},
|
||||||
|
"wsl": {
|
||||||
|
"role": "wsl",
|
||||||
|
"user": "user"
|
||||||
|
},
|
||||||
|
"htpc-bako": {
|
||||||
|
"role": "htpc",
|
||||||
|
"user": "starr"
|
||||||
|
}
|
||||||
|
}
|
@ -1,11 +1,11 @@
|
|||||||
{ config, lib, pkgs, user, ... }:
|
{ config, lib, pkgs, user, hostname, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./steam-deck.nix
|
./steam-deck.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Set networking options
|
# Set networking options
|
||||||
networking.hostName = "bulwark";
|
networking.hostName = "${hostname}";
|
||||||
networking.firewall.checkReversePath = "loose";
|
networking.firewall.checkReversePath = "loose";
|
||||||
networking.firewall.enable = false;
|
networking.firewall.enable = false;
|
||||||
|
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
{ lib, system, user, inputs, agenix, home-manager, jovian-nixos, ... }:
|
{ lib, specialArgs, system, inputs, agenix, home-manager, jovian-nixos, ... }:
|
||||||
{
|
let
|
||||||
|
user = specialArgs.user;
|
||||||
|
hostname = specialArgs.hostname;
|
||||||
|
in {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = { inherit user inputs home-manager jovian-nixos; };
|
specialArgs = { inherit user inputs home-manager jovian-nixos; };
|
||||||
modules = [
|
modules = [
|
||||||
|
26
provision/hosts/htpc/configuration.nix
Normal file
26
provision/hosts/htpc/configuration.nix
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{ config, pkgs, user, lib, hostname, ... }:
|
||||||
|
{
|
||||||
|
# Use performance governor for sweet gaming performance!
|
||||||
|
powerManagement.cpuFreqGovernor = "performance";
|
||||||
|
|
||||||
|
# Set networking options
|
||||||
|
networking.hostName = "${hostname}";
|
||||||
|
networking.firewall.checkReversePath = "loose";
|
||||||
|
networking.firewall.enable = false;
|
||||||
|
|
||||||
|
# Modules
|
||||||
|
modules = {
|
||||||
|
desktop = {
|
||||||
|
enable = true;
|
||||||
|
gnome.enable = true;
|
||||||
|
};
|
||||||
|
programs = {
|
||||||
|
chezmoi.apply = true;
|
||||||
|
kitty.enable = true;
|
||||||
|
};
|
||||||
|
services = {
|
||||||
|
samba-client.enable = true;
|
||||||
|
ssh.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
21
provision/hosts/htpc/default.nix
Normal file
21
provision/hosts/htpc/default.nix
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{ lib, specialArgs, system, inputs, agenix, home-manager, ... }:
|
||||||
|
let
|
||||||
|
user = specialArgs.user;
|
||||||
|
hostname = specialArgs.hostname;
|
||||||
|
in {
|
||||||
|
inherit system;
|
||||||
|
specialArgs = { inherit user hostname inputs home-manager; };
|
||||||
|
modules = [
|
||||||
|
../default # shared by all configs
|
||||||
|
../default/physical/configuration.nix # shared by physical machines
|
||||||
|
./configuration.nix # htpc specific
|
||||||
|
../../modules
|
||||||
|
/etc/nixos/hardware-configuration.nix
|
||||||
|
agenix.nixosModules.default
|
||||||
|
home-manager.nixosModules.home-manager {
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.extraSpecialArgs = { inherit user; };
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
{ config, pkgs, user, lib, ... }:
|
{ config, pkgs, user, lib, hostname, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./backup.nix
|
./backup.nix
|
||||||
@ -9,7 +9,7 @@
|
|||||||
powerManagement.cpuFreqGovernor = "performance";
|
powerManagement.cpuFreqGovernor = "performance";
|
||||||
|
|
||||||
# Set networking options
|
# Set networking options
|
||||||
networking.hostName = "kestrel";
|
networking.hostName = "${hostname}";
|
||||||
networking.firewall.checkReversePath = "loose";
|
networking.firewall.checkReversePath = "loose";
|
||||||
networking.firewall.enable = false;
|
networking.firewall.enable = false;
|
||||||
|
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
{ lib, system, user, inputs, agenix, home-manager, ... }:
|
{ lib, specialArgs, system, inputs, agenix, home-manager, ... }:
|
||||||
{
|
let
|
||||||
|
user = specialArgs.user;
|
||||||
|
hostname = specialArgs.hostname;
|
||||||
|
in {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = { inherit user inputs home-manager; };
|
specialArgs = { inherit user hostname inputs home-manager; };
|
||||||
modules = [
|
modules = [
|
||||||
../default # shared by all configs
|
../default # shared by all configs
|
||||||
../default/physical/configuration.nix # shared by physical machines
|
../default/physical/configuration.nix # shared by physical machines
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{ config, pkgs, user, lib, ... }:
|
{ config, pkgs, user, lib, hostname, ... }:
|
||||||
{
|
{
|
||||||
# Use performance governor for sweet gaming performance!
|
# Use performance governor for sweet gaming performance!
|
||||||
powerManagement.cpuFreqGovernor = "performance";
|
powerManagement.cpuFreqGovernor = "performance";
|
||||||
|
|
||||||
# Set networking options
|
# Set networking options
|
||||||
networking.hostName = "osprey";
|
networking.hostName = "${hostname}";
|
||||||
networking.firewall.checkReversePath = false;
|
networking.firewall.checkReversePath = false;
|
||||||
networking.firewall.enable = false;
|
networking.firewall.enable = false;
|
||||||
|
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
{ lib, system, user, inputs, agenix, home-manager, ... }:
|
{ lib, specialArgs, system, inputs, agenix, home-manager, ... }:
|
||||||
{
|
let
|
||||||
|
user = specialArgs.user;
|
||||||
|
hostname = specialArgs.hostname;
|
||||||
|
in {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = { inherit user inputs home-manager; };
|
specialArgs = { inherit user inputs home-manager; };
|
||||||
modules = [
|
modules = [
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{ config, pkgs, user, lib, ... }:
|
{ config, pkgs, user, lib, hostname, ... }:
|
||||||
{
|
{
|
||||||
# Use performance governor for sweet gaming performance!
|
# Use performance governor for sweet gaming performance!
|
||||||
powerManagement.cpuFreqGovernor = "performance";
|
powerManagement.cpuFreqGovernor = "performance";
|
||||||
|
|
||||||
# Set networking options
|
# Set networking options
|
||||||
networking.hostName = "shivan";
|
networking.hostName = "${hostname}";
|
||||||
networking.firewall.checkReversePath = "loose";
|
networking.firewall.checkReversePath = "loose";
|
||||||
networking.firewall.enable = false;
|
networking.firewall.enable = false;
|
||||||
|
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
{ lib, system, user, inputs, agenix, home-manager, ... }:
|
{ lib, specialArgs, system, inputs, agenix, home-manager, ... }:
|
||||||
{
|
let
|
||||||
|
user = specialArgs.user;
|
||||||
|
hostname = specialArgs.hostname;
|
||||||
|
in {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = { inherit user inputs home-manager; };
|
specialArgs = { inherit user inputs home-manager; };
|
||||||
modules = [
|
modules = [
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, pkgs, user, lib, ... }:
|
{ config, pkgs, user, lib, hostname, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./wireguard-server.nix
|
./wireguard-server.nix
|
||||||
@ -18,7 +18,7 @@
|
|||||||
boot.kernelModules = [ "sg" ];
|
boot.kernelModules = [ "sg" ];
|
||||||
|
|
||||||
# Set networking options
|
# Set networking options
|
||||||
networking.hostName = "torus";
|
networking.hostName = "${hostname}";
|
||||||
networking.firewall.enable = true;
|
networking.firewall.enable = true;
|
||||||
networking.firewall.checkReversePath = "loose";
|
networking.firewall.checkReversePath = "loose";
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
{ lib, system, user, inputs, agenix, home-manager, ... }:
|
{ lib, specialArgs, system, inputs, agenix, home-manager, ... }:
|
||||||
{
|
let
|
||||||
|
user = specialArgs.user;
|
||||||
|
hostname = specialArgs.hostname;
|
||||||
|
in {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = { inherit user inputs home-manager; };
|
specialArgs = { inherit user inputs home-manager; };
|
||||||
modules = [
|
modules = [
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, pkgs, user, lib, inputs, nixos-wsl, ... }:
|
{ config, pkgs, user, lib, inputs, nixos-wsl, hostname, ... }:
|
||||||
let
|
let
|
||||||
defaultUser = user;
|
defaultUser = user;
|
||||||
in
|
in
|
||||||
@ -15,7 +15,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Set networking options
|
# Set networking options
|
||||||
networking.hostName = "wsl";
|
networking.hostName = "${hostname}";
|
||||||
networking.firewall.checkReversePath = "loose";
|
networking.firewall.checkReversePath = "loose";
|
||||||
networking.firewall.enable = false;
|
networking.firewall.enable = false;
|
||||||
|
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
{ lib, system, user, inputs, agenix, home-manager, nixos-wsl, ... }:
|
{ lib, specialArgs, system, inputs, agenix, home-manager, nixos-wsl, ... }:
|
||||||
{
|
let
|
||||||
|
user = specialArgs.user;
|
||||||
|
hostname = specialArgs.hostname;
|
||||||
|
in {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = { inherit user inputs nixos-wsl home-manager; };
|
specialArgs = { inherit user inputs nixos-wsl home-manager; };
|
||||||
modules = [
|
modules = [
|
||||||
|
@ -14,6 +14,13 @@ in {
|
|||||||
home-manager.users.${user} = {
|
home-manager.users.${user} = {
|
||||||
programs.firefox = {
|
programs.firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
policies = {
|
||||||
|
SecurityDevices = {
|
||||||
|
Add = {
|
||||||
|
"NIPR" = "${pkgs.opensc}/lib/opensc-pkcs11.so";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
profiles.default = {
|
profiles.default = {
|
||||||
bookmarks = import ./bookmarks.nix;
|
bookmarks = import ./bookmarks.nix;
|
||||||
isDefault = true;
|
isDefault = true;
|
||||||
|
@ -14,16 +14,17 @@ nix-shell -p vim git neovim
|
|||||||
git clone https://github.com/starr-dusT/dotfiles ~/.local/share/chezmoi
|
git clone https://github.com/starr-dusT/dotfiles ~/.local/share/chezmoi
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Copy existing configuration files from another host and modify as needed. Make sure to move the installer created configuration-hardware.nix to dotfiles (e.g. `provision/hosts/<host>/hardware.nix`).
|
3. Copy existing configuration files from another host and modify as needed. For most configs, move the installer created `configuration-hardware.nix` to dotfiles (e.g. `provision/hosts/<host>/hardware.nix`); however, role-based installs like `htpc` and `wsl` either do not require a `hardware.nix` file or the flake imports `hardware-configuration.nix` from `/etc/nixos`.
|
||||||
|
|
||||||
4. If required move agenix keypairs to `~/.ssh/keys/{age,age.pub}`. A new keypair may be required and agenix files will need to be rekeyed on another system.
|
4. If required move agenix keypairs to `~/.ssh/keys/{age,age.pub}`. A new keypair may be required and agenix files will need to be rekeyed on another system.
|
||||||
|
|
||||||
5. Rebuild the system and initialize chezmoi dotfiles to save America:
|
5. Rebuild the system and initialize chezmoi dotfiles to save America:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo nixos-rebuild switch --flake .#<host>
|
sudo nixos-rebuild switch --impure --flake .#<host>
|
||||||
chezmoi init && chezmoi apply
|
chezmoi init && chezmoi apply
|
||||||
```
|
```
|
||||||
|
*Note:* if the `chezmoi.apply` option is enabled in `configuration.nix` the dotfiles should deploy automatically. The chezmoi commands then are not necessary.
|
||||||
|
|
||||||
6. Profit!
|
6. Profit!
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user