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 = {
home-manager = {
agenix.url = "github:ryantm/agenix";
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
@ -12,7 +13,7 @@
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
inherit (self) outputs;
lib = nixpkgs.lib;
@ -21,7 +22,10 @@
nixosConfigurations = {
lkk-nix-1 = lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [ ./hosts/lkk-nix-1 ];
modules = [
./hosts/lkk-nix-1
agenix.nixosModules.age
];
};
};
homeConfigurations = {

View File

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

View File

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

View File

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

View File

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

View File

@ -2,57 +2,59 @@
with lib;
let cfg = config.features.tmux;
let cfg = config.features.cli.tmux;
in {
options.features.neofetch.enable = mkEnableOption "enable neofetch shell";
options.features.cli.tmux.enable = mkEnableOption "enable tmux";
programs.tmux = {
enable = true;
shortcut = "a";
keyMode = "vi";
clock24 = true;
extraConfig = ''
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
config = mkIf cfg.enable {
programs.tmux = {
enable = true;
shortcut = "a";
keyMode = "vi";
clock24 = true;
extraConfig = ''
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# change status bar color
bind-key r source-file ~/.tmux.conf \; display-message "Konfiguration neu geladen"
# change status bar color
bind-key r source-file ~/.tmux.conf \; display-message "Konfiguration neu geladen"
# status bar theme
set -g status-bg 'colour235'
#set -g message-command-fg 'colour222'
set -g status-justify 'centre'
set -g status-left-length '100'
set -g status 'on'
#set -g pane-active-border-fg 'colour154'
#set -g message-bg 'colour238'
set -g status-right-length '100'
#set -g status-right-attr 'none'
#set -g message-fg 'colour222'
#set -g message-command-bg 'colour238'
#set -g status-attr 'none'
#set -g status-utf8 'on'
#set -g pane-border-fg 'colour238'
#set -g status-left-attr 'none'
#setw -g window-status-fg 'colour121'
#setw -g window-status-attr 'none'
#setw -g window-status-activity-bg 'colour235'
#setw -g window-status-activity-attr 'none'
#setw -g window-status-activity-fg 'colour154'
setw -g window-status-separator ' '
#setw -g window-status-bg 'colour235'
set -g status-left '#[fg=colour232,bg=colour154] #S #[fg=colour154,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #W #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour121,bg=colour235] #(whoami)  #(uptime | cut -d " " -f 1,2,3) #[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]'
set -g status-right '#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour121,bg=colour235] %r  %a  %Y #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #H #[fg=colour154,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour232,bg=colour154] #(rainbarf --battery --remaining --no-rgb) '
setw -g window-status-format '#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[default] #I  #W #[fg=colour235,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]'
'';
# status bar theme
set -g status-bg 'colour235'
#set -g message-command-fg 'colour222'
set -g status-justify 'centre'
set -g status-left-length '100'
set -g status 'on'
#set -g pane-active-border-fg 'colour154'
#set -g message-bg 'colour238'
set -g status-right-length '100'
#set -g status-right-attr 'none'
#set -g message-fg 'colour222'
#set -g message-command-bg 'colour238'
#set -g status-attr 'none'
#set -g status-utf8 'on'
#set -g pane-border-fg 'colour238'
#set -g status-left-attr 'none'
#setw -g window-status-fg 'colour121'
#setw -g window-status-attr 'none'
#setw -g window-status-activity-bg 'colour235'
#setw -g window-status-activity-attr 'none'
#setw -g window-status-activity-fg 'colour154'
setw -g window-status-separator ' '
#setw -g window-status-bg 'colour235'
set -g status-left '#[fg=colour232,bg=colour154] #S #[fg=colour154,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #W #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour121,bg=colour235] #(whoami)  #(uptime | cut -d " " -f 1,2,3) #[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]'
set -g status-right '#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour121,bg=colour235] %r  %a  %Y #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #H #[fg=colour154,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour232,bg=colour154] #(rainbarf --battery --remaining --no-rgb) '
setw -g window-status-format '#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[default] #I  #W #[fg=colour235,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, ... }: {
imports = [
./steam.nix
./sunshine.nix
];
home.packages = with pkgs; [
gamescope
goverlay
mangohud
protonup-ng
];
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 = {
enable = 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,14 +1,12 @@
{ config, pkgs, ... }: {
imports = [
./base
../../features/cli
];
imports = [ ./base ../../features/cli ];
features = {
fish.enable = true;
starship.enable = true;
neofetch.enable = true;
cli = {
fish.enable = true;
starship.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;
let
cfg = config.features.foo;
features = { lib, config, ... }: {
options.foo = mkEnableOption "Enable CLI support";
features = {
cli = {
fish.enable = true;
neofetch.enable = true;
starship.enable = true;
tmux.enable = true;
};
gaming = {
steam.enable = true;
sunshine.enable = true;
};
desktop = {
};
virtualization = {
in {
config = mkIf cfg.foo.enable {
import = ../../features/cli;
};
};
# imports = [
# ./base
# ../../features/cli
# ];
# monitor config
home.stateVersion = "22.11";
}

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 = {
enable = 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Æø±Ž "(´×