diff --git a/flake.nix b/flake.nix index 5c18da9..d82afa7 100644 --- a/flake.nix +++ b/flake.nix @@ -98,7 +98,7 @@ # Export your module system for use in other flakes nixosModules = { default = ./modules/nixos; - osbm = ./modules/nixos; # Alias with your name + osbm = ./modules/nixos; # Alias with your name }; # If you also want to export home-manager modules diff --git a/modules/nixos/services/vscode-server.nix b/modules/nixos/services/vscode-server.nix index 7df7b67..0c51e62 100644 --- a/modules/nixos/services/vscode-server.nix +++ b/modules/nixos/services/vscode-server.nix @@ -5,52 +5,54 @@ ... }: { - config = (lib.mkIf config.osbmModules.services.vscode-server.enable { - services.code-server = { - # only true if the machine is not pochita - enable = config.networking.hostName != "pochita"; - port = 4444; - disableTelemetry = true; - disableUpdateCheck = true; - user = "osbm"; - group = "users"; - # auth = "none"; - host = "${config.networking.hostName}.curl-boga.ts.net"; - hashedPassword = "$argon2i$v=19$m=4096,t=3,p=1$dGc0TStGMDNzSS9JRkJYUFp3d091Q2p0bXlzPQ$zvdE9BkclkJmyFaenzPy2E99SEqsyDMt4IQNZfcfFFQ"; - package = pkgs.vscode-with-extensions.override { - vscode = pkgs.code-server; - vscodeExtensions = - with pkgs.vscode-extensions; - [ - bbenoist.nix - catppuccin.catppuccin-vsc - catppuccin.catppuccin-vsc-icons - charliermarsh.ruff - davidanson.vscode-markdownlint - esbenp.prettier-vscode - foxundermoon.shell-format - github.copilot - github.vscode-github-actions - github.vscode-pull-request-github - jnoortheen.nix-ide - kamadorueda.alejandra - ms-azuretools.vscode-docker - ms-python.python - # ms-vscode-remote.remote-ssh - timonwong.shellcheck - tyriar.sort-lines - ] - ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ - { - # Available in nixpkgs, but outdated (0.4.0) at the time of adding - name = "vscode-tailscale"; - publisher = "tailscale"; - sha256 = "sha256-MKiCZ4Vu+0HS2Kl5+60cWnOtb3udyEriwc+qb/7qgUg="; - version = "1.0.0"; - } - ]; + config = ( + lib.mkIf config.osbmModules.services.vscode-server.enable { + services.code-server = { + # only true if the machine is not pochita + enable = config.networking.hostName != "pochita"; + port = 4444; + disableTelemetry = true; + disableUpdateCheck = true; + user = "osbm"; + group = "users"; + # auth = "none"; + host = "${config.networking.hostName}.curl-boga.ts.net"; + hashedPassword = "$argon2i$v=19$m=4096,t=3,p=1$dGc0TStGMDNzSS9JRkJYUFp3d091Q2p0bXlzPQ$zvdE9BkclkJmyFaenzPy2E99SEqsyDMt4IQNZfcfFFQ"; + package = pkgs.vscode-with-extensions.override { + vscode = pkgs.code-server; + vscodeExtensions = + with pkgs.vscode-extensions; + [ + bbenoist.nix + catppuccin.catppuccin-vsc + catppuccin.catppuccin-vsc-icons + charliermarsh.ruff + davidanson.vscode-markdownlint + esbenp.prettier-vscode + foxundermoon.shell-format + github.copilot + github.vscode-github-actions + github.vscode-pull-request-github + jnoortheen.nix-ide + kamadorueda.alejandra + ms-azuretools.vscode-docker + ms-python.python + # ms-vscode-remote.remote-ssh + timonwong.shellcheck + tyriar.sort-lines + ] + ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + { + # Available in nixpkgs, but outdated (0.4.0) at the time of adding + name = "vscode-tailscale"; + publisher = "tailscale"; + sha256 = "sha256-MKiCZ4Vu+0HS2Kl5+60cWnOtb3udyEriwc+qb/7qgUg="; + version = "1.0.0"; + } + ]; + }; }; - }; - networking.firewall.allowedTCPPorts = [ config.services.code-server.port ]; - }); + networking.firewall.allowedTCPPorts = [ config.services.code-server.port ]; + } + ); } diff --git a/modules/nixos/system/impermanence.nix b/modules/nixos/system/impermanence.nix index 5d67b94..c65a043 100644 --- a/modules/nixos/system/impermanence.nix +++ b/modules/nixos/system/impermanence.nix @@ -1,15 +1,26 @@ -# impermanence -{lib, inputs, config, ...}: +# impermanence +{ + lib, + inputs, + config, + ... +}: let # Filter out 'root' from the users list since it's a special system user regularUsers = builtins.filter (u: u != "root") config.osbmModules.users; - + # Generate user persistence configuration userPersistence = lib.genAttrs regularUsers (username: { directories = [ "Documents" - { directory = ".gnupg"; mode = "0700"; } - { directory = ".ssh"; mode = "0700"; } + { + directory = ".gnupg"; + mode = "0700"; + } + { + directory = ".ssh"; + mode = "0700"; + } ".local/share/direnv" ]; # files = [ @@ -40,4 +51,4 @@ in }; }) ]; -} \ No newline at end of file +}