Skeleton for docker container, agenix added

This commit is contained in:
m3tam3re 2023-01-09 16:03:01 +01:00
parent d093113830
commit d4a14b79c3
21 changed files with 208 additions and 123 deletions

View File

@ -5,6 +5,7 @@
inputs = { inputs = {
home-manager = { home-manager = {
agenix.url = "github:ryantm/agenix";
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
@ -12,7 +13,7 @@
deploy-rs.url = "github:serokell/deploy-rs"; deploy-rs.url = "github:serokell/deploy-rs";
}; };
outputs = { self, nixpkgs, home-manager, deploy-rs, ... }@inputs: outputs = { self, nixpkgs, home-manager, agenix, deploy-rs, ... }@inputs:
let let
inherit (self) outputs; inherit (self) outputs;
lib = nixpkgs.lib; lib = nixpkgs.lib;
@ -21,7 +22,10 @@
nixosConfigurations = { nixosConfigurations = {
lkk-nix-1 = lib.nixosSystem { lkk-nix-1 = lib.nixosSystem {
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
modules = [ ./hosts/lkk-nix-1 ]; modules = [
./hosts/lkk-nix-1
agenix.nixosModules.age
];
}; };
}; };
homeConfigurations = { homeConfigurations = {

View File

@ -12,6 +12,7 @@
autojump autojump
bc bc
comma comma
direnv
exa exa
fd fd
httpie httpie

View File

@ -2,11 +2,11 @@
with lib; with lib;
let cfg = config.features.fish; let cfg = config.features.cli.fish;
in { in {
options.features.fish.enable = mkEnableOption "enable fish shell"; options.features.cli.fish.enable = mkEnableOption "enable fish shell";
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.fish = { programs.fish = {

View File

@ -2,11 +2,11 @@
with lib; with lib;
let cfg = config.features.neofetch; let cfg = config.features.cli.neofetch;
in { in {
options.features.neofetch.enable = mkEnableOption "enable neofetch shell"; options.features.cli.neofetch.enable = mkEnableOption "enable neofetch";
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.fish.interactiveShellInit = "neofetch --ascii-distro nixos"; programs.fish.interactiveShellInit = "neofetch --ascii-distro nixos";

View File

@ -2,11 +2,11 @@
with lib; with lib;
let cfg = config.features.fish; let cfg = config.features.cli.starship;
in { in {
options.features.starship.enable = mkEnableOption "enable starship prompt"; options.features.cli.starship.enable = mkEnableOption "enable starship prompt";
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.starship = { programs.starship = {

View File

@ -2,12 +2,13 @@
with lib; with lib;
let cfg = config.features.tmux; let cfg = config.features.cli.tmux;
in { in {
options.features.neofetch.enable = mkEnableOption "enable neofetch shell"; options.features.cli.tmux.enable = mkEnableOption "enable tmux";
config = mkIf cfg.enable {
programs.tmux = { programs.tmux = {
enable = true; enable = true;
shortcut = "a"; shortcut = "a";
@ -55,4 +56,5 @@ in {
setw -g window-status-current-format '#[fg=colour235,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #I  #W  #F #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]' setw -g window-status-current-format '#[fg=colour235,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #I  #W  #F #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]'
''; '';
}; };
};
} }

View File

@ -1,22 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.features.extrafonts;
in {
options.features.extrafonts.enable = mkEnableOption "install additional fonts for desktop apps";
config = mkIf cfg.enable {
home.packages = with pkgs; [
fira-code
fira-code-symbols
font-manager
font-awesome
font-awesome_4
nerdfonts
noto-fonts
];
};
}

View File

@ -1,11 +1,16 @@
{ pkgs, ... }: { { pkgs, ... }: {
imports = [ imports = [
./steam.nix ./steam.nix
./sunshine.nix
]; ];
home.packages = with pkgs; [ home.packages = with pkgs; [
gamescope gamescope
goverlay goverlay
mangohud mangohud
protonup-ng
]; ];
programs.gamemode.enable = true; programs.gamemode.enable = true;
} }

View File

@ -1,4 +1,14 @@
{ { config, lib, pkgs, ... }:
with lib;
let cfg = config.features.gaming.steam;
in {
options.features.gaming.steam.enable = mkEnableOption "enable Steam";
config = mkIf cfg.enable {
programs.steam = { programs.steam = {
enable = true; enable = true;
remotePlay.openFirewall = true; remotePlay.openFirewall = true;

View File

@ -0,0 +1,16 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.features.gaming.steam;
in {
options.features.gaming.sunshine.enable = mkEnableOption "enable Steam";
config = mkIf cfg.enable {
home.packages = with pkgs; [ sunshine ];
};
}

View File

@ -1,18 +0,0 @@
{ config, pkgs, ... }:
{
imports = [
];
features = {
fish.enable = true;
neofetch.enable = true;
startship.enable = true;
tmux.enable = true;
};
home.stateVersion = "22.11";
}

View File

@ -1 +0,0 @@
m3tam3re@m3-nix.4219:1672483267

View File

@ -1,13 +1,11 @@
{ config, pkgs, ... }: { { config, pkgs, ... }: {
imports = [ imports = [ ./base ../../features/cli ];
./base
../../features/cli
];
features = { features = {
cli = {
fish.enable = true; fish.enable = true;
starship.enable = true; starship.enable = true;
neofetch.enable = true; };
}; };
home.stateVersion = "22.11"; home.stateVersion = "22.11";

View File

@ -1,23 +1,32 @@
{ config, lib, pkgs, ... }: { config, pkgs, ... }: {
imports = [
./base
../../features/cli
../../features/coding
../../features/desktop
../../features/gaming
../../features/virtualization
];
with lib; features = {
cli = {
fish.enable = true;
neofetch.enable = true;
starship.enable = true;
tmux.enable = true;
};
gaming = {
steam.enable = true;
sunshine.enable = true;
};
desktop = {
};
virtualization = {
let
cfg = config.features.foo;
features = { lib, config, ... }: {
options.foo = mkEnableOption "Enable CLI support";
}; };
in {
config = mkIf cfg.foo.enable {
import = ../../features/cli;
}; };
# imports = [ home.stateVersion = "22.11";
# ./base
# ../../features/cli
# ];
# monitor config
} }

View File

@ -0,0 +1,33 @@
{ config, inputs, settings, ... }: {
age.secrets.mj-smtp-user.file = ../../../../secrets/mj-smtp-user.age;
age.secrets.mj-smtp-pass.file = ../../../../secrets/mj-smtp-pass.age;
virtualisation.arion = {
backend = "docker"; #//TODO continue here
# projects = {
# "baserow" = settings.services."baserow".service = {
# image = "";
# restart = "unless-stopped";
# environment = {
# BASEROW_PUBLIC_URL = "https://br.lanakk.com";
# POSTGRES_USER = "baserow";
# POSTGRES_PASSWORD = "baserow";
# POSTGRES_DB = "baserow";
# DATABASE_HOST = "postgres";
# DATABASE_NAME = "baserow";
# DATABASE_USER = "baserow";
# DATABASE_PASSWORD = "baserow";
# DATABASE_PORT = "5432";
# FROM_EMAIL = "hi@lanakk.com";
# EMAIL_SMTP = "in-v3.mailjet.com";
# EMAIL_SMTP_HOST = "in-v3.mailjet.com";
# EMAIL_SMTP_PORT = "587";
# EMAIL_SMTP_USER = config.age.secrets.mj-smtp-user.path;
# EMAIL_SMTP_PASSWORD = config.age.secrets.mj-smtp-pass.path;
# };
# };
# };
};
}

View File

@ -0,0 +1,5 @@
{
imports = [
./baserow.nix
];
}

View File

@ -3,5 +3,10 @@
virtualisation.docker = { virtualisation.docker = {
enable = true; enable = true;
enableOnBoot = true; enableOnBoot = true;
storageDrive = "btrfs";
rootless = {
enable = true;
setSocketVariable = true;
};
}; };
} }

6
secrets.nix Normal file
View File

@ -0,0 +1,6 @@
let
m3tam3re = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC3YEmpYbM+cpmyD10tzNRHEn526Z3LJOzYpWEKdJg8DaYyPbDn9iyVX30Nja2SrW4Wadws0Y8DW+Urs25/wVB6mKl7jgPJVkMi5hfobu3XAz8gwSdjDzRSWJrhjynuaXiTtRYED2INbvjLuxx3X8coNwMw58OuUuw5kNJp5aS2qFmHEYQErQsGT4MNqESe3jvTP27Z5pSneBj45LmGK+RcaSnJe7hG+KRtjuhjI7RdzMeDCX73SfUsal+rHeuEw/mmjYmiIItXhFTDn8ZvVwpBKv7xsJG90DkaX2vaTk0wgJdMnpVIuIRBa4EkmMWOQ3bMLGkLQeK/4FUkNcvQ/4+zcZsg4cY9Q7Fj55DD41hAUdF6SYODtn5qMPsTCnJz44glHt/oseKXMSd556NIw2HOvihbJW7Rwl4OEjGaO/dF4nUw4c9tHWmMn9dLslAVpUuZOb7ykgP0jk79ldT3Dv+2Hj0CdAWT2cJAdFX58KQ9jUPT3tBnObSF1lGMI7t77VU=";
in {
"mj-smtp-user.age".publicKeys = [ m3tam3re ];
"mj-smtp-pass.age".publicKeys = [ m3tam3re ];
}

16
secrets/mj-smtp-pass.age Normal file
View File

@ -0,0 +1,16 @@
age-encryption.org/v1
-> ssh-rsa DQlE7w
TVcGTRFtB2aJ3Tq3S5k8jSSsF5DUq20hRlXFzi/SY2UczJjzPIO+Qax/7gBmPxGM
i9sp89CHAz1owTEzFkxsdj7AMoz6SMlvPL9Ixc3zrwKthhz2puv/JiKsmzycNQd1
XvSzOKkJgZMG25Y7lBWjIy+SGTBDVUSaN1UUs2VRGhEBh0LW76+8dgJMdtzaFy4n
E2Yf3jj8MCjfBa6iX+G+ZTlWAl0ZhgBsJVmy9sN77AHQoUJVZ5FUllpy+sayV3iW
btwSlZMWlA4btbdZbV6PffGgHAMPCLu8OseIFDkLky12wt9ChK9A4OOZcFw4+bMb
YvDUOaQqtjqbZ8XSmokQVBNns9TxUcNcJ68cMz0qbm9Pj+gcY0k3zbsDfrpPNbpX
X3ZUWJVK594Uv2V9mKR6VVcYOrzvucD5iGqfO7SUTWJppldrB0/YGe3eGxmtG0D2
4K0JntFoDRThSyyGx1/YvPxAJqKBWT7SARUxGjMaqnWM3OWppKDBYLGl/jRQQAqf
-> VGV-grease OQ :S.YU\
M4HB0MfSl0giX1GydEobdPW85+T6loiGtSWgzhWESbY28rwZulR83bUX8ftEzemT
LF9AKGIr50etdijB9uypYf9sQarujWXPsMyNQG/Xyfo
--- Ns60O8WsNVrAkDvDfoI/opMnBjlKrRiFehRcUDCPAXg
ZÞÞwŠÁÅTJ;´ÞÊ=k7·_U55ˆYFçàÂë&¦?÷‘Ã.øÛ…U¨çü"Ü ¹>ç D~Ïž qyÖÝD

16
secrets/mj-smtp-user.age Normal file
View File

@ -0,0 +1,16 @@
age-encryption.org/v1
-> ssh-rsa DQlE7w
GZ5/RD7yNwlvFjNwv/rxjsl2GVF8lRm0qlXfOeQcYctyDo4xHFsIbhLpwV508rJf
zeLJpoQYFaqumEtgxBeZrQS+qYiOG3Ne2pO36MN3qq/wVVBPuWiupNBrZTUeHn2n
1BTENMzmPfqhuZL2D62NXKcIsbOiGADtdt/4h3Xk4CyroBuEfNFx0U9WTMGHx5mg
kUVC2jRzo0KbnFwFTeGYmUc90dgy/rciAqhkBOfbPpcYdUy6LTVrGbz0jxwutIq1
SmkMW7pj/KSPAgVnX6p38gWobVxyRIFmC0wrFZ/NCy2Hq4ae0QdkX/I0TabEBtbj
vcacZDlfXEsV+n3gvl8qzOVJO1inc3ZV8QUgnK5QEaV6JF37XONeczi8/qFT7e9K
fCUw0gG5N7r6Ma3JcNctEtB5NsgBXJXe3Fy3j6yT5sQQayPW4eS2yYuClUcYaaIe
xwDLpuRESYx0oh9DJZqvmoSZriLpejsJ54ZUVDJ57NAd+Vl1iCFKKOyMr/aUDNSM
-> r\&\-grease cT"t7WhI IM
LjM4kAZQbwNT8isi73f1V0PVVsJxWvjkSCLTaS8aD03LgYLYY9uCs6k/hyb3GdWw
1a/9BC907cyNGQ
--- ulEvcwLfcMfh78M+U9KeF1l39rdLG1NpVE9FLPCHOgI
]ƒSþ³KÖˆÓUèä;NÊL[6á(î e+ WU øÍL ±ô57ºÀ£9L†Vy\ GhÆø±Ž "(´×