mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-26 23:14:57 +08:00
refactor
This commit is contained in:
parent
f5de63c9ac
commit
ecb79359bf
2 changed files with 78 additions and 75 deletions
|
|
@ -2,17 +2,19 @@
|
|||
|
||||
# https://nixos.wiki/wiki/Distributed_build
|
||||
{
|
||||
nix.buildMachines = [{
|
||||
hostName = "162.55.241.231";
|
||||
system = "x86_64-linux";
|
||||
# if the builder supports building for multiple architectures,
|
||||
# replace the previous line by, e.g.,
|
||||
# systems = ["x86_64-linux" "aarch64-linux"];
|
||||
maxJobs = 16;
|
||||
speedFactor = 3;
|
||||
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
||||
mandatoryFeatures = [ ];
|
||||
}];
|
||||
nix.buildMachines = [
|
||||
{
|
||||
hostName = "162.55.89.216";
|
||||
system = "x86_64-linux";
|
||||
# if the builder supports building for multiple architectures,
|
||||
# replace the previous line by, e.g.,
|
||||
# systems = ["x86_64-linux" "aarch64-linux"];
|
||||
maxJobs = 16;
|
||||
speedFactor = 3;
|
||||
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
||||
mandatoryFeatures = [];
|
||||
}
|
||||
];
|
||||
nix.distributedBuilds = true;
|
||||
# optional, useful when the builder has a faster internet connection than yours
|
||||
nix.extraOptions = ''
|
||||
|
|
|
|||
129
flake.nix
129
flake.nix
|
|
@ -21,17 +21,16 @@
|
|||
outputs = inputs@{ self, home-manager, nixpkgs, ... }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
# Make configuration for any computer I use in my home office.
|
||||
mkHomeMachine = configurationNix: extraModules: nixpkgs.lib.nixosSystem {
|
||||
mkComputer = configurationNix: extraModules: nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
# Arguments to pass to all modules.
|
||||
specialArgs = { inherit system inputs; };
|
||||
modules = (
|
||||
[
|
||||
# System configuration
|
||||
# System configuration for this host
|
||||
configurationNix
|
||||
|
||||
# common
|
||||
# Configuration common to all of my systems (servers, desktops, laptops)
|
||||
./features/self-ide.nix
|
||||
./features/takemessh
|
||||
./features/caches
|
||||
|
|
@ -53,66 +52,68 @@
|
|||
);
|
||||
};
|
||||
in
|
||||
{
|
||||
# The "name" in nixosConfigurations.${name} should match the `hostname`
|
||||
#
|
||||
nixosConfigurations = {
|
||||
p71 = mkHomeMachine
|
||||
./hosts/p71.nix
|
||||
[
|
||||
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-p53
|
||||
./features/desktopish
|
||||
#./features/gnome.nix
|
||||
./features/desktopish/guiapps.nix
|
||||
./features/server/devserver.nix
|
||||
./features/ema/emanote.nix
|
||||
#./features/virtualbox.nix
|
||||
./features/lxd.nix
|
||||
#./features/server-mode.nix
|
||||
# ./features/postgrest.nix
|
||||
./features/server/devserver.nix
|
||||
];
|
||||
x1c7 = mkHomeMachine
|
||||
./hosts/x1c7.nix
|
||||
[
|
||||
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x1-7th-gen
|
||||
./features/distributed-build.nix
|
||||
./features/gnome.nix
|
||||
./features/desktopish/guiapps.nix
|
||||
];
|
||||
ryzen9 = mkHomeMachine
|
||||
./hosts/ryzen9.nix
|
||||
[
|
||||
./features/server/devserver.nix
|
||||
];
|
||||
{
|
||||
# The "name" in nixosConfigurations.${name} should match the `hostname`
|
||||
#
|
||||
nixosConfigurations = {
|
||||
p71 = mkComputer
|
||||
./hosts/p71.nix
|
||||
[
|
||||
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-p53
|
||||
./features/desktopish
|
||||
#./features/gnome.nix
|
||||
./features/desktopish/guiapps.nix
|
||||
./features/server/devserver.nix
|
||||
./features/ema/emanote.nix
|
||||
#./features/virtualbox.nix
|
||||
./features/lxd.nix
|
||||
#./features/server-mode.nix
|
||||
# ./features/postgrest.nix
|
||||
./features/server/devserver.nix
|
||||
];
|
||||
x1c7 = mkComputer
|
||||
./hosts/x1c7.nix
|
||||
[
|
||||
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x1-7th-gen
|
||||
./features/distributed-build.nix
|
||||
./features/gnome.nix
|
||||
./features/desktopish/guiapps.nix
|
||||
];
|
||||
ryzen9 = mkComputer
|
||||
./hosts/ryzen9.nix
|
||||
[
|
||||
./features/server/devserver.nix
|
||||
];
|
||||
};
|
||||
|
||||
# non-NixOS systems
|
||||
homeConfigurations =
|
||||
let
|
||||
username = "srid";
|
||||
baseConfiguration = {
|
||||
programs.home-manager.enable = true;
|
||||
home.username = "srid";
|
||||
home.homeDirectory = "/home/srid";
|
||||
};
|
||||
mkHomeConfig = cfg: home-manager.lib.homeManagerConfiguration {
|
||||
inherit username system;
|
||||
homeDirectory = "/home/${username}";
|
||||
configuration = baseConfiguration // cfg;
|
||||
};
|
||||
in
|
||||
{
|
||||
"P71" = mkHomeConfig (
|
||||
import ./home.nix {
|
||||
inherit inputs system;
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
}
|
||||
);
|
||||
# FIXME: This is broken on Clear Linux
|
||||
"x1c7" = mkHomeConfig {
|
||||
programs.git = import ./home/git.nix;
|
||||
programs.tmux = import ./home/tmux.nix;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# non-NixOS systems
|
||||
homeConfigurations =
|
||||
let
|
||||
username = "srid";
|
||||
baseConfiguration = {
|
||||
programs.home-manager.enable = true;
|
||||
home.username = "srid";
|
||||
home.homeDirectory = "/home/srid";
|
||||
};
|
||||
mkHomeConfig = cfg: home-manager.lib.homeManagerConfiguration {
|
||||
inherit username system;
|
||||
homeDirectory = "/home/${username}";
|
||||
configuration = baseConfiguration // cfg;
|
||||
};
|
||||
in
|
||||
{
|
||||
"P71" = mkHomeConfig (import ./home.nix {
|
||||
inherit inputs system;
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
});
|
||||
# FIXME: This is broken on Clear Linux
|
||||
"x1c7" = mkHomeConfig {
|
||||
programs.git = import ./home/git.nix;
|
||||
programs.tmux = import ./home/tmux.nix;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue