Restructure

This commit is contained in:
Alexander Wainwright
2025-06-26 21:38:14 +10:00
parent 9e14290937
commit ce30261865
6 changed files with 146 additions and 145 deletions

View File

@@ -16,30 +16,30 @@
};
outputs = { self, nixpkgs, home-manager, ... }@inputs: {
nixosConfigurations.case = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
nixosConfigurations = {
case = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
# Import the previous configuration.nix we used,
# so the old configuration file still takes effect
./configuration.nix
specialArgs = { inherit inputs; };
modules = [
# make home-manager as a module of nixos so that home-manager
# configuration will be deployed automatically when executing
# `nixos-rebuild switch`
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
./hosts/case/configuration.nix
home-manager.users.alex = import ./alex/home.nix;
# enable home manager
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
# Optionally, use home-manager.extraSpecialArgs to pass arguments to
# home.nix
home-manager.extraSpecialArgs = { inherit inputs; };
}
];
home-manager.users.alex = import ./alex/home.nix;
# Optionally, use home-manager.extraSpecialArgs to pass arguments to
# home.nix
home-manager.extraSpecialArgs = { inherit inputs; };
}
];
# other hosts...
};
};
};
}

View File

@@ -0,0 +1,38 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, inputs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
../modules/base.nix
../modules/desktop.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "case"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# run locutus every hour
services.cron = {
enable = true;
systemCronJobs = [
"27 * * * * root locutus backup 2>&1 | logger -t locutus-backup"
];
};
environment.etc."locutus/locutus.toml".source = ./locutus.toml;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "25.05"; # Did you read the comment?
}

View File

@@ -1,25 +1,15 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, inputs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
# Define a user account. Don't forget to set a password with passwd.
users.users.alex = {
isNormalUser = true;
description = "Alexander Wainwright";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
# thunderbird
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "case"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
shell = pkgs.fish;
};
# Enable networking
networking.networkmanager.enable = true;
@@ -44,50 +34,28 @@
LC_TIME = "en_AU.UTF-8";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "dvorak";
};
# Configure console keymap
console.keyMap = "dvorak";
# Enable CUPS to print documents.
services.printing.enable = true;
# fish shell
programs.fish.enable = true;
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# Create a library path that only applies to unpackaged programs by using
# nix-ldo
# https://nix.dev/guides/faq#how-to-run-non-nix-executables
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [
# Add any missing dynamic libraries for unpackaged programs
# here, NOT in environment.systemPackages
];
# 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;
};
# run locutus every hour
services.cron = {
enable = true;
systemCronJobs = [
"27 * * * * root locutus backup 2>&1 | logger -t locutus-backup"
];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Enable the Flakes feature and the accompanying new nix command-line tool
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Enable zeroconf
services.avahi = {
enable = true;
nssmdns4 = true; # Enables Avahi for name service lookups (e.g., in /etc/nsswitch.conf)
@@ -104,42 +72,26 @@
# services.resolved.extraConfig = "MulticastDNS=yes";
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
environment.variables.EDITOR = "nvim";
# Create a library path that only applies to unpackaged programs by using
# nix-ldo
# https://nix.dev/guides/faq#how-to-run-non-nix-executables
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [
# Add any missing dynamic libraries for unpackaged programs
# here, NOT in environment.systemPackages
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
programs.fish.enable = true;
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.alex = {
isNormalUser = true;
description = "Alexander Wainwright";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
# thunderbird
];
shell = pkgs.fish;
};
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Install firefox.
programs.firefox.enable = true;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Enable the Flakes feature and the accompanying new nix command-line tool
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# List packages installed in system profile. To search, run:
# $ nix search wget
# Packages
environment.systemPackages = with pkgs; [
avahi
bat
@@ -160,7 +112,6 @@
uv
wget
zip
mullvad-vpn
binutils
cmake
@@ -168,41 +119,5 @@
clang
gnumake
libtool
inputs.locutus.packages.${pkgs.system}.default
];
environment.etc."locutus/locutus.toml".source = ./locutus.toml;
environment.variables.EDITOR = "nvim";
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.mullvad-vpn.package = pkgs.mullvad-vpn;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "25.05"; # Did you read the comment?
}

48
hosts/modules/desktop.nix Normal file
View File

@@ -0,0 +1,48 @@
{ config, pkgs, inputs, ... }:
{
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "dvorak";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.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;
};
# Mullvad vpn
services.mullvad-vpn.package = pkgs.mullvad-vpn;
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Install firefox.
programs.firefox.enable = true;
environment.systemPackages = with pkgs; [
inputs.locutus.packages.${pkgs.system}.default
mullvad-vpn
];
}