Restructure flake.nix for a simpler config for building different images off the same NixOS config.
This commit is contained in:
@@ -8,33 +8,44 @@
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
sshfs
|
||||
];
|
||||
|
||||
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
||||
hideMounts = true;
|
||||
users.talexander = {
|
||||
files = [
|
||||
".ssh/known_hosts"
|
||||
];
|
||||
};
|
||||
users.root = {
|
||||
home = "/root";
|
||||
files = [
|
||||
".ssh/known_hosts"
|
||||
];
|
||||
options.me = {
|
||||
ssh.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install ssh.";
|
||||
};
|
||||
};
|
||||
|
||||
me.install.user.root.file = {
|
||||
".ssh/config" = {
|
||||
source = ./files/ssh_config_root;
|
||||
config = lib.mkIf config.me.ssh.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
sshfs
|
||||
];
|
||||
|
||||
environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) {
|
||||
hideMounts = true;
|
||||
users.talexander = {
|
||||
files = [
|
||||
".ssh/known_hosts"
|
||||
];
|
||||
};
|
||||
users.root = {
|
||||
home = "/root";
|
||||
files = [
|
||||
".ssh/known_hosts"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
me.install.user.talexander.file = {
|
||||
".ssh/config" = {
|
||||
source = ./files/ssh_config;
|
||||
|
||||
me.install.user.root.file = {
|
||||
".ssh/config" = {
|
||||
source = ./files/ssh_config_root;
|
||||
};
|
||||
};
|
||||
me.install.user.talexander.file = {
|
||||
".ssh/config" = {
|
||||
source = ./files/ssh_config;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user