meta: Remove variables from containers

Modules solve the variable problem in a nicer way.
This commit is contained in:
Donovan Glover 2023-06-22 11:43:19 -04:00
parent 7316153e37
commit 0aaba9a591
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
7 changed files with 21 additions and 48 deletions

View File

@ -1,7 +1,5 @@
{ home-manager, ... }:
let
VARIABLES = import ../src/variables.nix;
in
{
containers.dev = {
privateNetwork = true;
@ -11,7 +9,7 @@ in
bindMounts = {
"/mnt" = {
hostPath = "/home/${VARIABLES.username}/containers/dev";
hostPath = "/home/user/containers/dev";
isReadOnly = false;
};
};
@ -40,7 +38,7 @@ in
};
home-manager.users.user = { pkgs, ... }: {
home.stateVersion = VARIABLES.stateVersion;
home.stateVersion = "22.11";
};
environment = {
@ -49,7 +47,7 @@ in
};
environment.systemPackages = with pkgs; [ kitty ];
system.stateVersion = VARIABLES.stateVersion;
system.stateVersion = "22.11";
};
};
}

View File

@ -1,7 +1,5 @@
{ home-manager, stylix, ... }:
let
VARIABLES = import ../src/variables.nix;
in
{
containers.gui = {
privateNetwork = true;
@ -9,7 +7,7 @@ in
bindMounts = {
"/mnt" = {
hostPath = "/home/${VARIABLES.username}/containers/gui";
hostPath = "/home/user/containers/gui";
isReadOnly = false;
};
@ -54,12 +52,9 @@ in
};
};
#home-manager.sharedModules = [{
#}];
home-manager.users.user = { pkgs, ... }: {
home.packages = [ pkgs.atool pkgs.httpie ];
home.stateVersion = VARIABLES.stateVersion;
home.stateVersion = "22.11";
};
environment = {
@ -67,8 +62,7 @@ in
defaultPackages = [ ];
};
# environment.systemPackages = with pkgs; [ kitty ];
system.stateVersion = VARIABLES.stateVersion;
system.stateVersion = "22.11";
};
};
}

View File

@ -1,12 +1,11 @@
{ lib, ... }:
let VARIABLES = import ../src/variables.nix; in {
{ lib, ... }: {
containers.obsidian = {
privateNetwork = true;
ephemeral = true;
bindMounts = {
"/mnt" = {
hostPath = "/home/${VARIABLES.username}/containers/obsidian";
hostPath = "/home/user/containers/obsidian";
isReadOnly = false;
};
@ -23,9 +22,6 @@ let VARIABLES = import ../src/variables.nix; in {
};
config = { pkgs, ... }: {
i18n.defaultLocale = VARIABLES.defaultLocale;
i18n.supportedLocales = VARIABLES.supportedLocales;
users = {
mutableUsers = false;
allowNoPasswordLogin = true;
@ -67,7 +63,7 @@ let VARIABLES = import ../src/variables.nix; in {
"obsidian"
];
system.stateVersion = VARIABLES.stateVersion;
system.stateVersion = "22.11";
};
};
}

View File

@ -1,10 +1,10 @@
let VARIABLES = import ../src/variables.nix; in {
{
containers.rar = {
privateNetwork = true;
bindMounts = {
"/home/user" = {
hostPath = "/home/${VARIABLES.username}/containers/rar";
hostPath = "/home/user/containers/rar";
isReadOnly = false;
};
};
@ -49,7 +49,7 @@ let VARIABLES = import ../src/variables.nix; in {
"unrar"
];
system.stateVersion = VARIABLES.stateVersion;
system.stateVersion = "22.11";
};
};
}

View File

@ -1,15 +1,11 @@
{ home-manager, stylix, ... }:
let
VARIABLES = import ../src/variables.nix;
in
{
{ home-manager, stylix, ... }: {
containers.srb2 = {
privateNetwork = true;
ephemeral = true;
bindMounts = {
"/home/user/.srb2" = {
hostPath = "/home/${VARIABLES.username}/containers/srb2";
hostPath = "/home/user/containers/srb2";
isReadOnly = false;
};
@ -62,7 +58,7 @@ in
};
home-manager.users.user = { ... }: {
home.stateVersion = VARIABLES.stateVersion;
home.stateVersion = "22.11";
};
environment = {
@ -70,7 +66,7 @@ in
defaultPackages = [ ];
};
system.stateVersion = VARIABLES.stateVersion;
system.stateVersion = "22.11";
};
};
}

View File

@ -1,11 +1,10 @@
let VARIABLES = import ../src/variables.nix; in {
containers.wine = {
privateNetwork = true;
ephemeral = true;
bindMounts = {
"/home/user" = {
hostPath = "/home/${VARIABLES.username}/containers/wine";
"/mnt" = {
hostPath = "/home/user/containers/wine";
isReadOnly = false;
};
@ -44,8 +43,6 @@ let VARIABLES = import ../src/variables.nix; in {
starship.enable = true;
};
i18n.defaultLocale = VARIABLES.defaultLocale;
i18n.supportedLocales = VARIABLES.supportedLocales;
users = {
defaultUserShell = pkgs.fish;
@ -92,7 +89,7 @@ let VARIABLES = import ../src/variables.nix; in {
driSupport32Bit = true;
};
system.stateVersion = VARIABLES.stateVersion;
system.stateVersion = "22.11";
};
};
}

View File

@ -1,8 +0,0 @@
{
hostname = "nixos";
system = "x86_64-linux";
hostHardwareConfiguration = ../hardware/laptop.nix;
stateVersion = "22.11";
username = "user";
defaultBrowser = "librewolf";
}