mirror of
https://github.com/srid/nixos-config.git
synced 2026-02-04 03:53:35 +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
|
# https://nixos.wiki/wiki/Distributed_build
|
||||||
{
|
{
|
||||||
nix.buildMachines = [{
|
nix.buildMachines = [
|
||||||
hostName = "162.55.241.231";
|
{
|
||||||
system = "x86_64-linux";
|
hostName = "162.55.89.216";
|
||||||
# if the builder supports building for multiple architectures,
|
system = "x86_64-linux";
|
||||||
# replace the previous line by, e.g.,
|
# if the builder supports building for multiple architectures,
|
||||||
# systems = ["x86_64-linux" "aarch64-linux"];
|
# replace the previous line by, e.g.,
|
||||||
maxJobs = 16;
|
# systems = ["x86_64-linux" "aarch64-linux"];
|
||||||
speedFactor = 3;
|
maxJobs = 16;
|
||||||
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
speedFactor = 3;
|
||||||
mandatoryFeatures = [ ];
|
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
||||||
}];
|
mandatoryFeatures = [];
|
||||||
|
}
|
||||||
|
];
|
||||||
nix.distributedBuilds = true;
|
nix.distributedBuilds = true;
|
||||||
# optional, useful when the builder has a faster internet connection than yours
|
# optional, useful when the builder has a faster internet connection than yours
|
||||||
nix.extraOptions = ''
|
nix.extraOptions = ''
|
||||||
|
|
|
||||||
129
flake.nix
129
flake.nix
|
|
@ -21,17 +21,16 @@
|
||||||
outputs = inputs@{ self, home-manager, nixpkgs, ... }:
|
outputs = inputs@{ self, home-manager, nixpkgs, ... }:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
# Make configuration for any computer I use in my home office.
|
mkComputer = configurationNix: extraModules: nixpkgs.lib.nixosSystem {
|
||||||
mkHomeMachine = configurationNix: extraModules: nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
inherit system;
|
||||||
# Arguments to pass to all modules.
|
# Arguments to pass to all modules.
|
||||||
specialArgs = { inherit system inputs; };
|
specialArgs = { inherit system inputs; };
|
||||||
modules = (
|
modules = (
|
||||||
[
|
[
|
||||||
# System configuration
|
# System configuration for this host
|
||||||
configurationNix
|
configurationNix
|
||||||
|
|
||||||
# common
|
# Configuration common to all of my systems (servers, desktops, laptops)
|
||||||
./features/self-ide.nix
|
./features/self-ide.nix
|
||||||
./features/takemessh
|
./features/takemessh
|
||||||
./features/caches
|
./features/caches
|
||||||
|
|
@ -53,66 +52,68 @@
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# The "name" in nixosConfigurations.${name} should match the `hostname`
|
# The "name" in nixosConfigurations.${name} should match the `hostname`
|
||||||
#
|
#
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
p71 = mkHomeMachine
|
p71 = mkComputer
|
||||||
./hosts/p71.nix
|
./hosts/p71.nix
|
||||||
[
|
[
|
||||||
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-p53
|
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-p53
|
||||||
./features/desktopish
|
./features/desktopish
|
||||||
#./features/gnome.nix
|
#./features/gnome.nix
|
||||||
./features/desktopish/guiapps.nix
|
./features/desktopish/guiapps.nix
|
||||||
./features/server/devserver.nix
|
./features/server/devserver.nix
|
||||||
./features/ema/emanote.nix
|
./features/ema/emanote.nix
|
||||||
#./features/virtualbox.nix
|
#./features/virtualbox.nix
|
||||||
./features/lxd.nix
|
./features/lxd.nix
|
||||||
#./features/server-mode.nix
|
#./features/server-mode.nix
|
||||||
# ./features/postgrest.nix
|
# ./features/postgrest.nix
|
||||||
./features/server/devserver.nix
|
./features/server/devserver.nix
|
||||||
];
|
];
|
||||||
x1c7 = mkHomeMachine
|
x1c7 = mkComputer
|
||||||
./hosts/x1c7.nix
|
./hosts/x1c7.nix
|
||||||
[
|
[
|
||||||
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x1-7th-gen
|
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x1-7th-gen
|
||||||
./features/distributed-build.nix
|
./features/distributed-build.nix
|
||||||
./features/gnome.nix
|
./features/gnome.nix
|
||||||
./features/desktopish/guiapps.nix
|
./features/desktopish/guiapps.nix
|
||||||
];
|
];
|
||||||
ryzen9 = mkHomeMachine
|
ryzen9 = mkComputer
|
||||||
./hosts/ryzen9.nix
|
./hosts/ryzen9.nix
|
||||||
[
|
[
|
||||||
./features/server/devserver.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