Reorganize hosts and modules
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
{ lib, config, ... }:
|
||||
with lib;
|
||||
{
|
||||
options = {
|
||||
tools.coding = {
|
||||
enable = mkEnableOption "Enable coding tools";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.tools.coding.enable {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
config = {
|
||||
init.defaultBranch = "master";
|
||||
user = {
|
||||
email = "git@nettika.cat";
|
||||
name = "Nettika";
|
||||
};
|
||||
credential.helper = "store";
|
||||
};
|
||||
};
|
||||
programs.nano = {
|
||||
enable = true;
|
||||
nanorc = ''
|
||||
set autoindent
|
||||
set linenumbers
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./coding.nix
|
||||
./secrets.nix
|
||||
];
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
{
|
||||
options = {
|
||||
tools.secrets = {
|
||||
enable = mkEnableOption "Enable secret-management tools";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.tools.secrets.enable {
|
||||
environment.systemPackages = [ pkgs.git-crypt ];
|
||||
};
|
||||
}
|
20
flake.nix
20
flake.nix
@@ -5,26 +5,24 @@
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, ... }@inputs:
|
||||
outputs = { self, nixpkgs, ... }@inputs:
|
||||
let
|
||||
secrets = builtins.fromJSON (builtins.readFile ./secrets.json);
|
||||
in {
|
||||
nixosModules = {
|
||||
common = import ./modules/common.nix;
|
||||
};
|
||||
|
||||
nixosConfigurations = {
|
||||
marauder = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./marauder
|
||||
./common
|
||||
];
|
||||
specialArgs = { inherit inputs secrets; };
|
||||
modules = [ ./hosts/marauder ];
|
||||
specialArgs = { inherit self inputs secrets; };
|
||||
};
|
||||
monolith = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./monolith
|
||||
./common
|
||||
];
|
||||
specialArgs = { inherit inputs secrets; };
|
||||
modules = [ ./hosts/monolith ];
|
||||
specialArgs = { inherit self inputs secrets; };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@@ -1,6 +1,9 @@
|
||||
{ pkgs, inputs, secrets, ... }:
|
||||
{ self, pkgs, inputs, secrets, ... }:
|
||||
{
|
||||
imports = [ ./backup.nix ];
|
||||
imports = [
|
||||
self.nixosModules.common
|
||||
./backup.nix
|
||||
];
|
||||
|
||||
networking.hostName = "marauder";
|
||||
|
||||
@@ -60,18 +63,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
tools.secrets = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
tools.coding = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Chat clients
|
||||
discord
|
@@ -1,4 +1,6 @@
|
||||
{ pkgs, secrets, ... }: {
|
||||
{ self, pkgs, secrets, ... }: {
|
||||
imports = [ self.nixosModules.common ];
|
||||
|
||||
networking = {
|
||||
hostName = "monolith";
|
||||
hostId = "44551c32";
|
||||
@@ -42,18 +44,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
tools.secrets = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
tools.coding = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings.PasswordAuthentication = false;
|
29
modules/common.nix
Normal file
29
modules/common.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
config = {
|
||||
init.defaultBranch = "master";
|
||||
user = {
|
||||
email = "git@nettika.cat";
|
||||
name = "Nettika";
|
||||
};
|
||||
credential.helper = "store";
|
||||
};
|
||||
};
|
||||
|
||||
programs.nano = {
|
||||
enable = true;
|
||||
nanorc = ''
|
||||
set autoindent
|
||||
set linenumbers
|
||||
'';
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.git-crypt ];
|
||||
}
|
Reference in New Issue
Block a user