First commit
This commit is contained in:
20
modules/system/agenix.nix
Normal file
20
modules/system/agenix.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
inputs.agenix.nixosModules.default
|
||||
];
|
||||
|
||||
environment.systemPackages = [
|
||||
inputs.agenix.packages.${pkgs.system}.default # CLI Tool
|
||||
];
|
||||
|
||||
age.secrets = {
|
||||
tailscale-auth.file = ../../secrets/tailscale-auth.age;
|
||||
eclypsecloud-eclypse.file = ../../secrets/eclypsecloud-eclypse.age;
|
||||
eclypse-password.file = ../../secrets/eclypse-password.age;
|
||||
};
|
||||
}
|
||||
14
modules/system/boot.nix
Normal file
14
modules/system/boot.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
configurationLimit = 10;
|
||||
};
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
18
modules/system/default.nix
Normal file
18
modules/system/default.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./agenix.nix
|
||||
./boot.nix
|
||||
./fileSystems.nix
|
||||
./fonts.nix
|
||||
./network.nix
|
||||
./packages.nix
|
||||
./security.nix
|
||||
./services.nix
|
||||
./system.nix
|
||||
./tailscale.nix
|
||||
./user.nix
|
||||
];
|
||||
}
|
||||
40
modules/system/fileSystems.nix
Normal file
40
modules/system/fileSystems.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
automount_opts = [
|
||||
"x-systemd.automount"
|
||||
"x-systemd.idle-timeout=60"
|
||||
"x-systemd.device-timeout=5s"
|
||||
"x-systemd.mount-timeout=5s"
|
||||
"noauto"
|
||||
"user"
|
||||
"users"
|
||||
];
|
||||
in
|
||||
{
|
||||
fileSystems = {
|
||||
"/mnt/EclypseCloud" = {
|
||||
device = "//100.78.212.35/EclypseCloud";
|
||||
fsType = "cifs";
|
||||
options = [
|
||||
"credentials=${config.age.secrets.eclypsecloud-eclypse.path}"
|
||||
"uid=${toString config.users.users.eclypse.uid}"
|
||||
"rw"
|
||||
] ++ automount_opts;
|
||||
};
|
||||
"/mnt/Music" = {
|
||||
device = "//100.78.212.35/music";
|
||||
fsType = "cifs";
|
||||
options = [
|
||||
"credentials=${config.age.secrets.eclypsecloud-eclypse.path}"
|
||||
"uid=${toString config.users.users.eclypse.uid}"
|
||||
"rw"
|
||||
] ++ automount_opts;
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [ cifs-utils ];
|
||||
}
|
||||
13
modules/system/fonts.nix
Normal file
13
modules/system/fonts.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
fonts = {
|
||||
enableDefaultPackages = true;
|
||||
fontconfig.enable = true;
|
||||
packages = with pkgs; [
|
||||
fira-code
|
||||
];
|
||||
};
|
||||
}
|
||||
23
modules/system/network.nix
Normal file
23
modules/system/network.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
host,
|
||||
...
|
||||
}:
|
||||
{
|
||||
networking = {
|
||||
hostName = "${host}"; # Define your hostname
|
||||
|
||||
# Pick only one of the below networking options.
|
||||
# wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# proxy.default = "http://user:password@proxy:port/";
|
||||
# proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
|
||||
# Open ports in the firewall.
|
||||
# firewall.allowedTCPPorts = [ ... ];
|
||||
# firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# firewall.enable = false;
|
||||
};
|
||||
}
|
||||
48
modules/system/packages.nix
Normal file
48
modules/system/packages.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
inputs.nur.modules.nixos.default # Adds the NUR overlay
|
||||
../overlays
|
||||
];
|
||||
|
||||
programs = {
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# mtr.enable = true;
|
||||
# gnupg.agent = {
|
||||
# enable = true;
|
||||
# enableSSHSupport = true;
|
||||
# };
|
||||
zsh.enable = true;
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
# ? For some reason, doing config.allowUnfree does not work
|
||||
# ? Maybe becuase it's not an explicit option?
|
||||
# ? https://search.nixos.org/options?channel=25.05&show=nixpkgs.config&query=nixpkgs.config
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
};
|
||||
};
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment = {
|
||||
pathsToLink = [ "/share/zsh" ];
|
||||
systemPackages = with pkgs; [
|
||||
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||
git
|
||||
# (catppuccin-sddm.override {
|
||||
# flavor = "mocha";
|
||||
# accent = "pink";
|
||||
# font = "FiraCode";
|
||||
# background = "${../../wallpapers/lanterns_of_twilight.png}";
|
||||
# loginBackground = true;
|
||||
# })
|
||||
];
|
||||
};
|
||||
}
|
||||
8
modules/system/security.nix
Normal file
8
modules/system/security.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
security = {
|
||||
rtkit.enable = true;
|
||||
};
|
||||
}
|
||||
56
modules/system/services.nix
Normal file
56
modules/system/services.nix
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
services = {
|
||||
xserver = {
|
||||
# Enable the X11 windowing system.
|
||||
# You can disable this if you're only using the Wayland session.
|
||||
enable = true;
|
||||
|
||||
# Configure keymap in X11
|
||||
xkb = {
|
||||
layout = "us";
|
||||
variant = "";
|
||||
};
|
||||
|
||||
# Enable touchpad support (enabled default in most desktopManager).
|
||||
# libinput.enable = true;
|
||||
};
|
||||
|
||||
# Enable the KDE Plasma Desktop Environment.
|
||||
displayManager.sddm = {
|
||||
enable = true;
|
||||
# theme = "catppuccin-mocha-pink";
|
||||
};
|
||||
desktopManager.plasma6.enable = true;
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
printing.enable = true;
|
||||
|
||||
# Enable sound with pipewire.
|
||||
pulseaudio.enable = false;
|
||||
pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# If you want to use JACK applications, uncomment this
|
||||
# jack.enable = true;
|
||||
|
||||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||
# no need to redefine it in your config for now)
|
||||
# media-session.enable = true;
|
||||
};
|
||||
|
||||
# Enable the OpenSSH daemon. (Look into Fail2Ban in the future)
|
||||
openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
PermitRootLogin = "prohibit-password";
|
||||
AllowUsers = [ "eclypse" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
70
modules/system/system.nix
Normal file
70
modules/system/system.nix
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
nix = {
|
||||
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
|
||||
settings = {
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
substituters = [
|
||||
"https://cache.nixos.org"
|
||||
"https://nix-community.cachix.org"
|
||||
"https://devenv.cachix.org"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "America/New_York";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n = {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_US.UTF-8";
|
||||
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||
LC_MEASUREMENT = "en_US.UTF-8";
|
||||
LC_MONETARY = "en_US.UTF-8";
|
||||
LC_NAME = "en_US.UTF-8";
|
||||
LC_NUMERIC = "en_US.UTF-8";
|
||||
LC_PAPER = "en_US.UTF-8";
|
||||
LC_TELEPHONE = "en_US.UTF-8";
|
||||
LC_TIME = "en_US.UTF-8";
|
||||
};
|
||||
};
|
||||
|
||||
# Select internationalisation properties.
|
||||
# console = {
|
||||
# font = "Lat2-Terminus16";
|
||||
# keyMap = "us";
|
||||
# useXkbConfig = true; # use xkb.options in tty.
|
||||
# };
|
||||
|
||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||
#
|
||||
# Most users should NEVER change this value after the initial install, for any reason,
|
||||
# even if you've upgraded your system to a new NixOS release.
|
||||
#
|
||||
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
||||
# to actually do that.
|
||||
#
|
||||
# This value being lower than the current NixOS release does NOT mean your system is
|
||||
# out of date, out of support, or vulnerable.
|
||||
#
|
||||
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||||
# and migrated your data accordingly.
|
||||
#
|
||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||
system.stateVersion = "25.05"; # Did you read the comment?
|
||||
}
|
||||
31
modules/system/tailscale.nix
Normal file
31
modules/system/tailscale.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
useRoutingFeatures = "client";
|
||||
authKeyFile = config.age.secrets.tailscale-auth.path;
|
||||
|
||||
# * Only applied if `authKeyFile` is specified
|
||||
extraUpFlags = [
|
||||
"--ssh"
|
||||
"--accept-routes=true"
|
||||
];
|
||||
extraSetFlags = [
|
||||
"--operator=eclypse"
|
||||
];
|
||||
};
|
||||
|
||||
# Taildrop
|
||||
systemd.user.services.taildrop = {
|
||||
description = "Taildrop File Receiver Service";
|
||||
wantedBy = [ "default.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.tailscale}/bin/tailscale file get --verbose --loop $HOME/Downloads/'";
|
||||
};
|
||||
};
|
||||
}
|
||||
41
modules/system/user.nix
Normal file
41
modules/system/user.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
host,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
||||
|
||||
home-manager = {
|
||||
useUserPackages = true;
|
||||
useGlobalPkgs = true;
|
||||
extraSpecialArgs = { inherit inputs host; };
|
||||
|
||||
users.eclypse = {
|
||||
imports = [ ../home ];
|
||||
home = {
|
||||
username = "eclypse";
|
||||
homeDirectory = "/home/eclypse";
|
||||
stateVersion = "25.05";
|
||||
};
|
||||
programs.home-manager.enable = true;
|
||||
};
|
||||
|
||||
backupFileExtension = "backup3";
|
||||
};
|
||||
|
||||
users.mutableUsers = false;
|
||||
users.users.eclypse = {
|
||||
isNormalUser = true;
|
||||
uid = 1000;
|
||||
description = "Eclypse";
|
||||
extraGroups = [
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
];
|
||||
hashedPasswordFile = config.age.secrets.eclypse-password.path;
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user