feat: modernize work config

This commit is contained in:
Michael Thomas 2023-08-14 17:03:13 -04:00
parent afbf17321d
commit 73810b2046
7 changed files with 83 additions and 38 deletions

57
flake.lock generated
View File

@ -73,6 +73,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_3": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -171,7 +189,8 @@
"nur": "nur", "nur": "nur",
"rust-overlay": "rust-overlay", "rust-overlay": "rust-overlay",
"unstable": "unstable", "unstable": "unstable",
"utils": "utils" "utils": "utils",
"vscode-server": "vscode-server"
} }
}, },
"rust-overlay": { "rust-overlay": {
@ -238,6 +257,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1688590700, "lastModified": 1688590700,
@ -270,6 +304,27 @@
"repo": "flake-utils", "repo": "flake-utils",
"type": "github" "type": "github"
} }
},
"vscode-server": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1684517665,
"narHash": "sha256-SaAr66uCQ8CF75jIr23FZjk1+9Kfwm5sQnwV25206Gs=",
"owner": "nix-community",
"repo": "nixos-vscode-server",
"rev": "1e1358493df6529d4c7bc4cc3066f76fd16d4ae6",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-vscode-server",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@ -15,6 +15,10 @@
nixpkgs.follows = "nixpkgs"; nixpkgs.follows = "nixpkgs";
}; };
}; };
vscode-server = {
url = "github:nix-community/nixos-vscode-server";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = { darwin = {
url = "github:lnl7/nix-darwin/master"; url = "github:lnl7/nix-darwin/master";
@ -29,7 +33,7 @@
}; };
}; };
outputs = { self, nixpkgs, unstable, nur, utils, rust-overlay, nixos-wsl, darwin, home-manager, ... }@inputs: { outputs = { self, nixpkgs, unstable, nur, utils, rust-overlay, nixos-wsl, vscode-server, darwin, home-manager, ... }@inputs: {
# This repo's overlay plus any other overlays you use # This repo's overlay plus any other overlays you use
# If you want to use packages from flakes that are not nixpkgs (such as NUR), add their overlays here.\ # If you want to use packages from flakes that are not nixpkgs (such as NUR), add their overlays here.\
@ -82,14 +86,15 @@
modules = [ modules = [
self.overlaysModule self.overlaysModule
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ vscode-server.nixosModules.default
nixpkgs.overlays = [ # {
(import ./overlays/iptables) # nixpkgs.overlays = [
]; # (import ./overlays/iptables)
} # ];
# }
./modules/containers.nix ./modules/containers.nix
./modules/nix.nix ./modules/nix.nix
./modules/vscode-server.nix # ./modules/vscode-server.nix
./machines/work/configuration.nix ./machines/work/configuration.nix
]; ];

View File

@ -1,4 +1,4 @@
{ lib, pkgs, config, modulesPath, inputs, ... }: { lib, pkgs, modulesPath, inputs, ... }:
with lib; with lib;
let let
@ -13,7 +13,10 @@ in
wsl = { wsl = {
enable = true; enable = true;
automountPath = "/mnt"; wslConf = {
automount.root = "/mnt";
interop.appendWindowsPath = false;
};
defaultUser = defaultUser; defaultUser = defaultUser;
startMenuLaunchers = true; startMenuLaunchers = true;
@ -34,25 +37,18 @@ in
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wget wget
]; ];
# Proxychains services.vscode-server.enable = true;
programs.proxychains = {
enable = true; programs.zsh.enable = true;
proxies.main = {
enable = true;
type = "http";
host = "172.21.32.1";
port = 1080;
};
};
users.users.${defaultUser} = { users.users.${defaultUser} = {
uid = pkgs.lib.mkForce 1001; uid = pkgs.lib.mkForce 1001;
extraGroups = [ "wheel" "docker" "podman" ]; extraGroups = [ "wheel" "docker" "podman" ];
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
system.stateVersion = "21.11"; system.stateVersion = "22.05";
} }

View File

@ -4,7 +4,7 @@
virtualisation.podman = { virtualisation.podman = {
enable = true; enable = true;
dockerSocket.enable = true; dockerSocket.enable = true;
defaultNetwork.dnsname.enable = true; defaultNetwork.settings.dns_enabled = true;
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [

View File

@ -1,10 +0,0 @@
{
imports = [
(fetchTarball {
url = "https://github.com/msteen/nixos-vscode-server/tarball/d2343b5eb47b811856085f3eff4d899a32b2c136";
sha256 = "sha256:1cszfjwshj6imkwip270ln4l1j328aw2zh9vm26wv3asnqlhdrak";
})
];
services.vscode-server.enable = true;
}

View File

@ -18,8 +18,7 @@
shellAliases = { shellAliases = {
code = "/mnt/c/Program\\ Files/Microsoft\\ VS\\ Code/Code.exe"; code = "/mnt/c/Program\\ Files/Microsoft\\ VS\\ Code/Code.exe";
}; };
profileExtra = ''
source $HOME/.profile
'';
}; };
home.stateVersion = "22.05";
} }

View File

@ -16,7 +16,7 @@
kubectl kubectl
kubernetes-helm kubernetes-helm
# Nix # Nix
rnix-lsp nil
nixpkgs-fmt nixpkgs-fmt
# Rust # Rust
(rust-bin.stable.latest.default.override { (rust-bin.stable.latest.default.override {