♻️ refactor common user / home-manager

This commit is contained in:
James Walker 2022-05-28 13:12:43 -04:00
parent ba073a2483
commit 8bb6ffce43
Signed by: walkah
GPG Key ID: 3C127179D6086E93
6 changed files with 90 additions and 93 deletions

View File

@ -7,11 +7,11 @@
"utils": "utils"
},
"locked": {
"lastModified": 1652079807,
"narHash": "sha256-aCs1EwO9K2yJ1DcT4+4g7BMlJBWP7Xjs4k5i8ueR8PU=",
"lastModified": 1653594315,
"narHash": "sha256-kJ0ENmnQJ4qL2FeYKZba9kvv1KmIuB3NVpBwMeI7AJQ=",
"owner": "serokell",
"repo": "deploy-rs",
"rev": "690f698b18345d894784752b5fa93b9b8f3cc29f",
"rev": "184349d8149436748986d1bdba087e4149e9c160",
"type": "github"
},
"original": {
@ -21,12 +21,7 @@
}
},
"dotfiles": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": [
"nixpkgs"
]
},
"flake": false,
"locked": {
"lastModified": 1652235633,
"narHash": "sha256-b9mIXMOFJdQQrxgvDMGw5W7rAAyPlNUovfYpfn1yVWo=",
@ -75,11 +70,11 @@
},
"flake-utils": {
"locked": {
"lastModified": 1652372896,
"narHash": "sha256-lURGussfF3mGrFPQT3zgW7+RC0pBhbHzco0C7I+ilow=",
"lastModified": 1652776076,
"narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "0d347c56f6f41de822a4f4c7ff5072f3382db121",
"rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8",
"type": "github"
},
"original": {
@ -89,36 +84,15 @@
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"dotfiles",
"nixpkgs"
]
},
"locked": {
"lastModified": 1640592198,
"narHash": "sha256-F5dWVGQMscmGyLTzNLocPB1v8Ijp8ONx8Nq9Dmi5PSw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "0b197562ab7bf114dd5f6716f41d4b5be6ccd357",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1652452043,
"narHash": "sha256-nh3mdVB/Kk5ag1uRMAlKo8r+ssN3HNxwbLsqRG4xZkw=",
"lastModified": 1653518057,
"narHash": "sha256-cam3Nfae5ADeEs6mRPzr0jXB7+DhyMIXz0/0Q13r/yk=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "273598f53e04f0111dca5724b37640e3907edaaf",
"rev": "64831f938bd413cefde0b0cf871febc494afaa4f",
"type": "github"
},
"original": {
@ -143,13 +117,45 @@
"type": "github"
}
},
"nixpkgs_2": {
"nixpkgs-21_11": {
"locked": {
"lastModified": 1652252629,
"narHash": "sha256-SvT64apetqc8P5nYp1/fOZvUmHUPdPFUZbhSpKy+1aI=",
"lastModified": 1653132211,
"narHash": "sha256-5ugEYisGqixwarfn3BJvuWDnO6gT/AoxlsA6jnG8Fv8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d2fc6856824cb87742177eefc8dd534bdb6c3439",
"rev": "b5991e4971523a5fcc9413b9003b58e5c15aa7d8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-21.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-22_05": {
"locked": {
"lastModified": 1653460991,
"narHash": "sha256-8MgFe84UUKw5k5MybirNH0S+oSluN2cRQGt+ZkW+dxQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0c3bf3a5c3ab6be29138b88900c417660a284fbd",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-22.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1653326962,
"narHash": "sha256-W8feCYqKTsMre4nAEpv5Kx1PVFC+hao/LwqtB2Wci/8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "41cc1d5d9584103be4108c1815c350e07c807036",
"type": "github"
},
"original": {
@ -159,11 +165,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1652231724,
"narHash": "sha256-MjalcXFZgcgchp4QqnF05JTkFBBGad5hbksA1EKoP98=",
"lastModified": 1653495658,
"narHash": "sha256-66YwJ6nuDHRxpYRiKtNC3qA9QkrHHJn6c+cJriiOGZI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "41ff747f882914c1f8c233207ce280ac9d0c867f",
"rev": "7fa8d8b2e206be87de8e4128441384f171c8a33b",
"type": "github"
},
"original": {
@ -179,7 +185,7 @@
"dotfiles": "dotfiles",
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils",
"home-manager": "home-manager_2",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs_3",
"sops-nix": "sops-nix"
}
@ -188,14 +194,16 @@
"inputs": {
"nixpkgs": [
"nixpkgs"
]
],
"nixpkgs-21_11": "nixpkgs-21_11",
"nixpkgs-22_05": "nixpkgs-22_05"
},
"locked": {
"lastModified": 1649756291,
"narHash": "sha256-KTll8bCINAzIUGaaMrbn9wb5nfhkXRLgmFrWGR/Dku0=",
"lastModified": 1653462763,
"narHash": "sha256-n0beO7WNvAeEtTtnetzQCaGs615tU/DfM97k8r/7bUw=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "c2614c4fe61943b3d280ac1892fcebe6e8eaf8c8",
"rev": "7385b12722ce903e477878147794bed9040227e2",
"type": "github"
},
"original": {

View File

@ -20,7 +20,7 @@
# My stuff
dotfiles = {
url = "github:walkah/dotfiles";
inputs.nixpkgs.follows = "nixpkgs";
flake = false;
};
};
@ -43,8 +43,6 @@
home-manager.nixosModules.home-manager
({ config, ... }: {
networking.hostName = hostName;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
})
] ++ modules;
specialArgs = inputs;
@ -61,19 +59,13 @@
}) // {
nixosConfigurations = {
# Aristotle
agent = mkSystem "agent" "aarch64-linux"
[ ./hosts/aristotle/configuration.nix ];
form = mkSystem "form" "aarch64-linux"
[ ./hosts/aristotle/configuration.nix ];
matter = mkSystem "matter" "aarch64-linux"
[ ./hosts/aristotle/configuration.nix ];
purpose = mkSystem "purpose" "aarch64-linux"
[ ./hosts/aristotle/configuration.nix ];
agent = mkSystem "agent" "aarch64-linux" [ ./hosts/aristotle/configuration.nix ];
form = mkSystem "form" "aarch64-linux" [ ./hosts/aristotle/configuration.nix ];
matter = mkSystem "matter" "aarch64-linux" [ ./hosts/aristotle/configuration.nix ];
purpose = mkSystem "purpose" "aarch64-linux" [ ./hosts/aristotle/configuration.nix ];
plato =
mkSystem "plato" "x86_64-linux" [ ./hosts/plato/configuration.nix ];
socrates = mkSystem "socrates" "x86_64-linux"
[ ./hosts/socrates/configuration.nix ];
plato = mkSystem "plato" "x86_64-linux" [ ./hosts/plato/configuration.nix ];
socrates = mkSystem "socrates" "x86_64-linux" [ ./hosts/socrates/configuration.nix ];
};
deploy.nodes = {
@ -125,11 +117,6 @@
path = deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.plato;
};
walkah = {
user = "walkah";
path = deploy-rs.lib.x86_64-linux.activate.home-manager
dotfiles.homeConfigurations.x86_64-linux;
};
};
};
@ -141,11 +128,6 @@
path = deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.socrates;
};
walkah = {
user = "walkah";
path = deploy-rs.lib.x86_64-linux.activate.home-manager
dotfiles.homeConfigurations.x86_64-linux;
};
};
};
};

View File

@ -2,6 +2,7 @@
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
../../users
../../modules/coredns
../../modules/code-server
@ -22,6 +23,10 @@
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [ (import ../../overlays) ];
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
# Set your time zone.
time.timeZone = "America/Toronto";
@ -36,15 +41,6 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ0mE4MyMnfd1b2nlBJT7kpZ6Vov+ILuGNfzdp5ZBNQe walkah@walkah.net"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC5spf4diguK+w7iYLFr565++6DjHukWfvpN2ru9dCRk nixbuild"
];
users.users.walkah = {
isNormalUser = true;
extraGroups = [ "wheel" "docker" ];
shell = pkgs.zsh;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ0mE4MyMnfd1b2nlBJT7kpZ6Vov+ILuGNfzdp5ZBNQe walkah@walkah.net"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM8YMax7PGIrcPNIHkpuNRFgn3HJK6Wepm+ycZWO6jfR walkah@walkah-ipadpro11"
];
};
system.autoUpgrade.enable = false;
environment.systemPackages = with pkgs; [ pinentry weechat ];

View File

@ -2,6 +2,7 @@
imports = [
./hardware-configuration.nix
./networking.nix # generated at runtime by nixos-infect
../../users
../../modules/coredns
../../modules/code-server/nginx.nix
@ -34,17 +35,6 @@
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ0mE4MyMnfd1b2nlBJT7kpZ6Vov+ILuGNfzdp5ZBNQe walkah@walkah.net"
];
users.users = {
walkah = {
extraGroups = [ "wheel" "docker" ];
isNormalUser = true;
shell = pkgs.zsh;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ0mE4MyMnfd1b2nlBJT7kpZ6Vov+ILuGNfzdp5ZBNQe walkah@walkah.net"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM8YMax7PGIrcPNIHkpuNRFgn3HJK6Wepm+ycZWO6jfR walkah@walkah-ipadpro11"
];
};
};
system.autoUpgrade.enable = false;
environment.systemPackages = with pkgs; [ ipfs-migrator ];

5
users/default.nix Normal file
View File

@ -0,0 +1,5 @@
{ config, lib, pkgs, ... }:
{
imports = [ ./walkah.nix ];
}

16
users/walkah.nix Normal file
View File

@ -0,0 +1,16 @@
{ config, lib, pkgs, dotfiles, ... }:
{
users.users.walkah = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [ "wheel" "docker" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ0mE4MyMnfd1b2nlBJT7kpZ6Vov+ILuGNfzdp5ZBNQe walkah@walkah.net"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM8YMax7PGIrcPNIHkpuNRFgn3HJK6Wepm+ycZWO6jfR walkah@walkah-ipadpro11"
];
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.walkah = import "${dotfiles}/home.nix";
}