init server modules

Former-commit-id: 98cf8e99b0
This commit is contained in:
Hadi
2025-03-18 23:09:42 +01:00
parent e26b4d0285
commit 16c9d54a30
4 changed files with 118 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
{ config, ... }: {
imports = [
../../nixos/home-manager.nix
../../nixos/nix.nix
../../nixos/systemd-boot.nix
../../nixos/users.nix
../../nixos/utils.nix
../../nixos/docker.nix
../../server-modules/ssh.nix
# You should let those lines as is
./hardware-configuration.nix
./variables.nix
];
home-manager.users."${config.var.username}" = import ./home.nix;
# Don't touch this
system.stateVersion = "24.05";
}

45
hosts/server/home.nix Normal file
View File

@@ -0,0 +1,45 @@
{ pkgs, config, ... }: {
imports = [
# Mostly user-specific configuration
./variables.nix
# Programs
../../home/programs/nvim
../../home/programs/shell
../../home/programs/fetch
../../home/programs/git
../../home/programs/lazygit
# Scripts
../../home/scripts # All scripts
];
home = {
inherit (config.var) username;
homeDirectory = "/home/" + config.var.username;
packages = with pkgs; [
# Dev
go
nodejs
python3
jq
just
pnpm
# Utils
zip
unzip
optipng
pfetch
btop
fastfetch
];
# Don't touch this
stateVersion = "24.05";
};
programs.home-manager.enable = true;
}

View File

@@ -0,0 +1,36 @@
{ config, lib, ... }: {
imports = [
# Choose your theme here:
../../themes/nixy.nix
];
config.var = {
hostname = "jack";
username = "hadi";
configDirectory = "/home/" + config.var.username
+ "/.config/nixos"; # The path of the nixos configuration directory
keyboardLayout = "fr";
location = "Paris";
timeZone = "Europe/Paris";
defaultLocale = "en_US.UTF-8";
extraLocale = "fr_FR.UTF-8";
git = {
username = "Hadi";
email = "112569860+anotherhadi@users.noreply.github.com";
};
autoUpgrade = false;
autoGarbageCollector = true;
};
# Let this here
options = {
var = lib.mkOption {
type = lib.types.attrs;
default = { };
};
};
}