Compare commits
2 Commits
0dbc007a90
...
95ffe7b908
| Author | SHA1 | Date | |
|---|---|---|---|
| 95ffe7b908 | |||
| ce02cc5538 |
@@ -76,7 +76,10 @@
|
|||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/${host}
|
./hosts/${host}
|
||||||
{ nixpkgs.hostPlatform = (myUtils.hostMeta ./hosts/${host}).system; }
|
{
|
||||||
|
nixpkgs.hostPlatform = (myUtils.hostMeta ./hosts/${host}).system;
|
||||||
|
host.name = host;
|
||||||
|
}
|
||||||
];
|
];
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit
|
inherit
|
||||||
|
|||||||
@@ -51,9 +51,7 @@ in
|
|||||||
../../modules/yubikey
|
../../modules/yubikey
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.${config.host.username} = import ../../home/hosts/andromache;
|
home-manager.users.${config.host.username} = import ../../home/hosts/${config.host.name};
|
||||||
|
|
||||||
ssh.authorizedHosts = [ "astyanax" ];
|
|
||||||
|
|
||||||
secrets.nixSigningKey.enable = true;
|
secrets.nixSigningKey.enable = true;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
host = {
|
host = {
|
||||||
username = "h";
|
username = "h";
|
||||||
name = "andromache";
|
|
||||||
highRam = true;
|
highRam = true;
|
||||||
|
admin = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,9 +47,7 @@ in
|
|||||||
../../modules/yubikey
|
../../modules/yubikey
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.${config.host.username} = import ../../home/hosts/astyanax;
|
home-manager.users.${config.host.username} = import ../../home/hosts/${config.host.name};
|
||||||
|
|
||||||
ssh.authorizedHosts = [ "andromache" ];
|
|
||||||
|
|
||||||
secrets.nixSigningKey.enable = true;
|
secrets.nixSigningKey.enable = true;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
host = {
|
host = {
|
||||||
username = "h";
|
username = "h";
|
||||||
name = "astyanax";
|
|
||||||
highRam = true;
|
highRam = true;
|
||||||
|
admin = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,13 +11,6 @@
|
|||||||
../../modules/ssh
|
../../modules/ssh
|
||||||
];
|
];
|
||||||
|
|
||||||
ssh = {
|
|
||||||
authorizedHosts = [
|
|
||||||
"andromache"
|
|
||||||
"astyanax"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
kernelParams = [
|
kernelParams = [
|
||||||
"console=ttyS1,115200n8"
|
"console=ttyS1,115200n8"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
host = {
|
host = {
|
||||||
username = "h";
|
username = "h";
|
||||||
name = "eetion-02";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,13 +15,6 @@
|
|||||||
|
|
||||||
tailscale.enable = true;
|
tailscale.enable = true;
|
||||||
|
|
||||||
ssh = {
|
|
||||||
authorizedHosts = [
|
|
||||||
"andromache"
|
|
||||||
"astyanax"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.loader = {
|
boot.loader = {
|
||||||
grub.enable = false;
|
grub.enable = false;
|
||||||
generic-extlinux-compatible.enable = true;
|
generic-extlinux-compatible.enable = true;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
host = {
|
host = {
|
||||||
username = "h";
|
username = "h";
|
||||||
name = "eetion";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,13 +18,6 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
networking.hostName = config.host.name;
|
networking.hostName = config.host.name;
|
||||||
ssh = {
|
|
||||||
authorizedHosts = [
|
|
||||||
"andromache"
|
|
||||||
"astyanax"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
docker.enable = true;
|
docker.enable = true;
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
host = {
|
host = {
|
||||||
username = "username";
|
username = "username";
|
||||||
name = "hecuba";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
host = {
|
host = {
|
||||||
username = "h";
|
username = "h";
|
||||||
name = "vm";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,6 @@ in
|
|||||||
name = "orange-pi";
|
name = "orange-pi";
|
||||||
};
|
};
|
||||||
|
|
||||||
ssh.authorizedHosts = [
|
|
||||||
"andromache"
|
|
||||||
"astyanax"
|
|
||||||
];
|
|
||||||
|
|
||||||
nix.settings.experimental-features = [
|
nix.settings.experimental-features = [
|
||||||
"nix-command"
|
"nix-command"
|
||||||
"flakes"
|
"flakes"
|
||||||
|
|||||||
@@ -21,11 +21,6 @@ in
|
|||||||
name = "raspberry-pi";
|
name = "raspberry-pi";
|
||||||
};
|
};
|
||||||
|
|
||||||
ssh.authorizedHosts = [
|
|
||||||
"andromache"
|
|
||||||
"astyanax"
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [
|
||||||
"console=ttyS1,115200n8"
|
"console=ttyS1,115200n8"
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -24,5 +24,10 @@
|
|||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
admin = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,20 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# error:
|
||||||
|
# Failed assertions:
|
||||||
|
# - h profile: xdg.portal: since you installed Home Manager via its NixOS module and
|
||||||
|
# 'home-manager.useUserPackages' is enabled, you need to add
|
||||||
|
#
|
||||||
|
# environment.pathsToLink = [ `/share/applications` `/share/xdg-desktop-portal` ];
|
||||||
|
#
|
||||||
|
# to your NixOS configuration so that the portal definitions and DE
|
||||||
|
# provided configurations get linked.
|
||||||
|
environment.pathsToLink = [
|
||||||
|
"/share/applications"
|
||||||
|
"/share/xdg-desktop-portal"
|
||||||
|
];
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
gnome.gnome-keyring.enable = false;
|
gnome.gnome-keyring.enable = false;
|
||||||
dbus.enable = true;
|
dbus.enable = true;
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
{ lib, config, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (config.host) username;
|
inherit (config.host) username;
|
||||||
|
adminHosts = (import ../../utils { inherit lib; }).adminHosts ../../hosts;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.ssh = {
|
options.ssh = {
|
||||||
@@ -19,6 +24,6 @@ in
|
|||||||
keyFile = ../../hosts/${hostname}/ssh_user.pub;
|
keyFile = ../../hosts/${hostname}/ssh_user.pub;
|
||||||
in
|
in
|
||||||
lib.optionals (builtins.pathExists keyFile) (lib.splitString "\n" (builtins.readFile keyFile))
|
lib.optionals (builtins.pathExists keyFile) (lib.splitString "\n" (builtins.readFile keyFile))
|
||||||
) config.ssh.authorizedHosts
|
) ((builtins.filter (h: h != config.host.name) adminHosts) ++ config.ssh.authorizedHosts)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
{ lib }:
|
{ lib }:
|
||||||
|
|
||||||
let
|
let
|
||||||
hosts = import ./hosts.nix;
|
fs = import ./fs.nix { inherit lib; };
|
||||||
|
hosts = import ./hosts.nix { inherit lib; };
|
||||||
secrets = import ./secrets.nix { inherit lib; };
|
secrets = import ./secrets.nix { inherit lib; };
|
||||||
in
|
in
|
||||||
{
|
fs // hosts // secrets
|
||||||
dirNames =
|
|
||||||
path: builtins.attrNames (lib.filterAttrs (_: type: type == "directory") (builtins.readDir path));
|
|
||||||
}
|
|
||||||
// hosts
|
|
||||||
// secrets
|
|
||||||
|
|||||||
6
utils/fs.nix
Normal file
6
utils/fs.nix
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{ lib }:
|
||||||
|
|
||||||
|
{
|
||||||
|
dirNames =
|
||||||
|
path: builtins.attrNames (lib.filterAttrs (_: t: t == "directory") (builtins.readDir path));
|
||||||
|
}
|
||||||
@@ -1,3 +1,8 @@
|
|||||||
|
{ lib }:
|
||||||
|
|
||||||
|
let
|
||||||
|
fs = import ./fs.nix { inherit lib; };
|
||||||
|
in
|
||||||
{
|
{
|
||||||
hostMeta =
|
hostMeta =
|
||||||
hostDir:
|
hostDir:
|
||||||
@@ -5,4 +10,10 @@
|
|||||||
import (hostDir + "/meta.nix")
|
import (hostDir + "/meta.nix")
|
||||||
else
|
else
|
||||||
throw "meta.nix required in ${hostDir}";
|
throw "meta.nix required in ${hostDir}";
|
||||||
|
|
||||||
|
adminHosts =
|
||||||
|
hostsPath:
|
||||||
|
builtins.filter (host: ((import (hostsPath + "/${host}/host.nix")).host.admin or false)) (
|
||||||
|
fs.dirNames hostsPath
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user