Move some extra bits into flake expression
This commit is contained in:
parent
016c5b7b68
commit
c241b30e6b
40
common.nix
40
common.nix
|
@ -1,40 +0,0 @@
|
|||
{lib, ...}: let
|
||||
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz";
|
||||
in {
|
||||
imports = [(import "${home-manager}/nixos")];
|
||||
nix = {
|
||||
settings.experimental-features = ["nix-command" "flakes"];
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "daily";
|
||||
options = "--delete-older-than 7d";
|
||||
};
|
||||
extraOptions = ''
|
||||
keep-outputs = true
|
||||
keep-derivations = true
|
||||
'';
|
||||
};
|
||||
system.autoUpgrade.enable = lib.mkDefault false;
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
home-manager = {
|
||||
useUserPackages = true;
|
||||
useGlobalPkgs = true;
|
||||
users.root = {
|
||||
imports = [./home/env/bash.nix ./home/env/starship.nix];
|
||||
home.username = "root";
|
||||
home.homeDirectory = "/root";
|
||||
home.stateVersion = "22.11";
|
||||
};
|
||||
};
|
||||
networking.networkmanager.enable = true;
|
||||
services.power-profiles-daemon.enable = true;
|
||||
virtualisation.podman.enable = true;
|
||||
programs = {
|
||||
ssh.startAgent = true;
|
||||
dconf.enable = true;
|
||||
fish.enable = true;
|
||||
zsh.enable = true;
|
||||
};
|
||||
fonts.fontconfig.enable = true;
|
||||
environment.localBinInPath = true;
|
||||
}
|
86
flake.nix
86
flake.nix
|
@ -13,15 +13,88 @@
|
|||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
}: {
|
||||
}: let
|
||||
common-config = {...}: {
|
||||
nix = {
|
||||
settings.experimental-features = ["nix-command" "flakes"];
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "daily";
|
||||
options = "--delete-older-than 7d";
|
||||
};
|
||||
extraOptions = ''
|
||||
keep-outputs = true
|
||||
keep-derivations = true
|
||||
'';
|
||||
};
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
firewall.enable = true;
|
||||
};
|
||||
services.power-profiles-daemon.enable = true;
|
||||
virtualisation.podman.enable = true;
|
||||
programs = {
|
||||
ssh.startAgent = true;
|
||||
dconf.enable = true;
|
||||
fish.enable = true;
|
||||
zsh.enable = true;
|
||||
};
|
||||
fonts.fontconfig.enable = true;
|
||||
environment.localBinInPath = true;
|
||||
};
|
||||
locale-en_GB = {...}: {
|
||||
services.xserver = {
|
||||
layout = "gb";
|
||||
xkbVariant = "";
|
||||
};
|
||||
console.keyMap = "uk";
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/London";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_GB.UTF-8";
|
||||
LC_IDENTIFICATION = "en_GB.UTF-8";
|
||||
LC_MEASUREMENT = "en_GB.UTF-8";
|
||||
LC_MONETARY = "en_GB.UTF-8";
|
||||
LC_NAME = "en_GB.UTF-8";
|
||||
LC_NUMERIC = "en_GB.UTF-8";
|
||||
LC_PAPER = "en_GB.UTF-8";
|
||||
LC_TELEPHONE = "en_GB.UTF-8";
|
||||
LC_TIME = "en_GB.UTF-8";
|
||||
};
|
||||
};
|
||||
audio = {...}: {
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
programs.noisetorch.enable = true;
|
||||
};
|
||||
bluetooth = {...}: {
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
};
|
||||
};
|
||||
in {
|
||||
nixosConfigurations = {
|
||||
Legion = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
common-config
|
||||
locale-en_GB
|
||||
./hosts/Legion/configuration.nix
|
||||
./common.nix
|
||||
./locales/en_GB.nix
|
||||
./services/Legion.nix
|
||||
];
|
||||
};
|
||||
|
@ -29,10 +102,11 @@
|
|||
system = "x86_64-linux";
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
common-config
|
||||
locale-en_GB
|
||||
audio
|
||||
bluetooth
|
||||
./hosts/N0245/configuration.nix
|
||||
./common.nix
|
||||
./hardware/audio.nix
|
||||
./hardware/bluetooth.nix
|
||||
./locales/en_GB.nix
|
||||
./wm/sway.nix
|
||||
./services/syncthing/N0245.nix
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
# Enable sound with pipewire.
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
programs.noisetorch.enable = true;
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{...}: {
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
};
|
||||
}
|
|
@ -7,8 +7,6 @@
|
|||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
nix.extraOptions = ''experimental-features = nix-command flakes '';
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
@ -16,7 +14,6 @@
|
|||
networking = {
|
||||
hostName = "Legion"; # Define your hostname.
|
||||
nameservers = ["192.168.1.230" "127.0.0.1" "9.9.9.9"];
|
||||
firewall = {enable = true;};
|
||||
};
|
||||
system.autoUpgrade = {
|
||||
enable = true;
|
||||
|
@ -35,7 +32,18 @@
|
|||
shell = pkgs.fish;
|
||||
openssh.authorizedKeys.keys = import ../../auth/authorized_keys.nix;
|
||||
};
|
||||
home-manager.users.xenia = import ./home.nix;
|
||||
home-manager.users.xenia = {
|
||||
imports = [../../home/personal.nix];
|
||||
home.username = "xenia";
|
||||
home.homeDirectory = "/home/xenia";
|
||||
home.stateVersion = "22.11";
|
||||
};
|
||||
home-manager.users.root = {
|
||||
imports = [../../home/env/bash.nix ../../home/env/starship.nix];
|
||||
home.username = "root";
|
||||
home.homeDirectory = "/root";
|
||||
home.stateVersion = "22.11";
|
||||
};
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
{...}: {
|
||||
imports = [../../home/personal.nix];
|
||||
home.username = "xenia";
|
||||
home.homeDirectory = "/home/xenia";
|
||||
home.stateVersion = "22.11";
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
{...}: {
|
||||
services.xserver = {
|
||||
layout = "gb";
|
||||
xkbVariant = "";
|
||||
};
|
||||
console.keyMap = "uk";
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/London";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_GB.UTF-8";
|
||||
LC_IDENTIFICATION = "en_GB.UTF-8";
|
||||
LC_MEASUREMENT = "en_GB.UTF-8";
|
||||
LC_MONETARY = "en_GB.UTF-8";
|
||||
LC_NAME = "en_GB.UTF-8";
|
||||
LC_NUMERIC = "en_GB.UTF-8";
|
||||
LC_PAPER = "en_GB.UTF-8";
|
||||
LC_TELEPHONE = "en_GB.UTF-8";
|
||||
LC_TIME = "en_GB.UTF-8";
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue