mirror of https://github.com/wlcx/home.git
flake: Refactor profiles system, add vscode
This commit is contained in:
parent
3720eb175c
commit
80bc6f91a4
|
@ -61,11 +61,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1661700591,
|
||||
"narHash": "sha256-NZa+z+TJC+Hk+87+LKkjFFmBn4GyMVEPcWFXFU+aTkU=",
|
||||
"lastModified": 1662874738,
|
||||
"narHash": "sha256-kG29aU9f5UTWhPf/QEh5LanDmqqbbcErWYAcPptC/Cg=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "16236dd7e33ba4579ccd3ca8349396b2f9c960fe",
|
||||
"rev": "dd1f4d982445a7d1b1869baa42f8f0f9bc606714",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
23
flake.nix
23
flake.nix
|
@ -28,36 +28,37 @@
|
|||
in (rec {
|
||||
lib = {
|
||||
mkHome = {
|
||||
profile,
|
||||
extraModules ? [],
|
||||
profiles,
|
||||
system,
|
||||
username ? "samw",
|
||||
}:
|
||||
inputs.home-manager.lib.homeManagerConfiguration rec {
|
||||
inputs.home-manager.lib.homeManagerConfiguration {
|
||||
inherit username system;
|
||||
stateVersion = "21.11";
|
||||
homeDirectory =
|
||||
if (inputs.nixpkgs.lib.systems.elaborate system).isDarwin
|
||||
then "/Users/${username}"
|
||||
else "/home/${username}";
|
||||
configuration = {...} @ args: ((profile args) // {nixpkgs.overlays = overlays;});
|
||||
extraSpecialArgs = {inherit system;};
|
||||
inherit extraModules;
|
||||
# In home-manager 22.11 configuration/extraModules go away and are replaced
|
||||
# by a single "modules". So let's get ready for that.
|
||||
configuration = {...}: {};
|
||||
extraSpecialArgs = { inherit system; };
|
||||
extraModules = profiles ++ [{ nixpkgs.overlays = overlays; }];
|
||||
};
|
||||
};
|
||||
profiles = import ./home/profiles.nix;
|
||||
|
||||
# Standalone home-manager configurations
|
||||
homeConfigurations = {
|
||||
homeConfigurations = let
|
||||
profiles = import ./home/profiles.nix;
|
||||
in {
|
||||
boron = lib.mkHome {
|
||||
system = "aarch64-darwin";
|
||||
profile = profiles.laptop;
|
||||
profiles = with profiles; [ default dev sensitive mac docker aws ];
|
||||
username = "samuel.willcocks";
|
||||
extraModules = [./home/docker.nix ./home/aws.nix];
|
||||
};
|
||||
zinc = lib.mkHome {
|
||||
system = "aarch64-darwin";
|
||||
profile = profiles.laptop;
|
||||
profiles = with profiles; [ default dev sensitive mac ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,18 +1,23 @@
|
|||
{
|
||||
# The basics that you'll want everywhere
|
||||
default = ./default.nix;
|
||||
# A machine for development
|
||||
dev = {...}: {
|
||||
imports = [./default.nix ./git.nix ./rust.nix ./vim.nix ./vim-dev];
|
||||
imports = [ ./git.nix ./rust.nix ./vim.nix ./vim-dev ./vscode.nix ];
|
||||
};
|
||||
laptop = {...}: {
|
||||
# Sensitive stuff
|
||||
sensitive = {...}: {
|
||||
imports = [
|
||||
./default.nix
|
||||
./git.nix
|
||||
./macs.nix
|
||||
./rust.nix
|
||||
./vim.nix
|
||||
./vim-dev
|
||||
./passwords.nix
|
||||
./gpg.nix
|
||||
];
|
||||
};
|
||||
# A MacOS machine
|
||||
mac = ./macs.nix;
|
||||
# A machine you want to do docker stuff on
|
||||
docker = ./docker.nix;
|
||||
# A machine you want to do aws stuff on
|
||||
aws = ./aws.nix;
|
||||
# A server
|
||||
server = {...}: {imports = [./default.nix ./git.nix ./vim.nix];};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
package = pkgs.vscodium;
|
||||
mutableExtensionsDir = false;
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
matklad.rust-analyzer
|
||||
jdinhlife.gruvbox
|
||||
];
|
||||
userSettings = {
|
||||
"update.mode" = "none";
|
||||
"workbench.colorTheme" = "Gruvbox Dark Hard";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue