reformat with nixfmt
This commit is contained in:
99
flake.nix
99
flake.nix
@ -16,70 +16,71 @@
|
|||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
# Other Flakes
|
# Other Flakes
|
||||||
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
||||||
nur.url = "github:nix-community/NUR";
|
nur.url = "github:nix-community/NUR";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Outputs is a function that takes the inputs as arguments.
|
# Outputs is a function that takes the inputs as arguments.
|
||||||
# To handle extra arguments we use the inputs@ pattern.
|
# To handle extra arguments we use the inputs@ pattern.
|
||||||
# It gives a name to the ... ellipses.
|
# It gives a name to the ... ellipses.
|
||||||
outputs = inputs @ { nixpkgs, home-manager, ... }:
|
outputs = inputs@{ nixpkgs, home-manager, ... }:
|
||||||
|
|
||||||
# With let you can define local variables
|
# With let you can define local variables
|
||||||
let
|
let
|
||||||
# We bring these functions into the scope for the outputs.
|
# We bring these functions into the scope for the outputs.
|
||||||
inherit (builtins) attrValues; # TODO: What does this do
|
inherit (builtins) attrValues; # TODO: What does this do
|
||||||
# inherit (nixpkgs.lib) nixosSystem;
|
# inherit (nixpkgs.lib) nixosSystem;
|
||||||
# inherit (home-manager.lib) homeManagerConfiguration;
|
# inherit (home-manager.lib) homeManagerConfiguration;
|
||||||
|
|
||||||
# Disabled since HomeManager module inherits these in extraSpecialArgs
|
# Disabled since HomeManager module inherits these in extraSpecialArgs
|
||||||
# Add overlays from other flakes so we can use them from pkgs.
|
# Add overlays from other flakes so we can use them from pkgs.
|
||||||
overlays = {
|
overlays = {
|
||||||
nur = inputs.nur.overlay;
|
nur = inputs.nur.overlay;
|
||||||
emacs = inputs.emacs-overlay.overlay;
|
emacs = inputs.emacs-overlay.overlay;
|
||||||
};
|
};
|
||||||
in
|
|
||||||
|
|
||||||
# The rec expression turns a basic set into a set where self-referencing is possible.
|
# The rec expression turns a basic set into a set where self-referencing is possible.
|
||||||
# It is a shorthand for recursive and allows to use the values defined in this set from its own scope.
|
# It is a shorthand for recursive and allows to use the values defined in this set from its own scope.
|
||||||
rec {
|
in rec {
|
||||||
|
|
||||||
# System configurations + HomeManager module
|
# System configurations + HomeManager module
|
||||||
# Accessible via 'nixos-rebuild'
|
# Accessible via 'nixos-rebuild'
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
# We give our configuration a name (the hostname) to choose a configuration when rebuilding.
|
# We give our configuration a name (the hostname) to choose a configuration when rebuilding.
|
||||||
# This makes it easy to add different configurations later (e.g. for a laptop).
|
# This makes it easy to add different configurations later (e.g. for a laptop).
|
||||||
# Usage: sudo nixos-rebuild switch --flake .#nixinator
|
# Usage: sudo nixos-rebuild switch --flake .#nixinator
|
||||||
nixinator = nixpkgs.lib.nixosSystem {
|
nixinator = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
# >> Main NixOS configuration file <<
|
# >> Main NixOS configuration file <<
|
||||||
modules = [
|
modules = [
|
||||||
# TODO: Modularize
|
# TODO: Modularize
|
||||||
./nixos/configuration.nix
|
./nixos/configuration.nix
|
||||||
|
|
||||||
# TODO: Investigate this { ... } module syntax
|
# TODO: Investigate this { ... } module syntax
|
||||||
# Overlays
|
# Overlays
|
||||||
{
|
{
|
||||||
# Since HomeManager uses global pkgs we can set the overlays here
|
# Since HomeManager uses global pkgs we can set the overlays here
|
||||||
nixpkgs.overlays = attrValues overlays;
|
nixpkgs.overlays = attrValues overlays;
|
||||||
}
|
}
|
||||||
|
|
||||||
# HomeManager
|
# HomeManager
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
home-manager.useGlobalPkgs = true; # Use systems pkgs, disables nixpkgs.* options in home.nix
|
home-manager.useGlobalPkgs =
|
||||||
home-manager.useUserPackages = true; # Enable installing packages through users.christoph.packages
|
true; # Use systems pkgs, disables nixpkgs.* options in home.nix
|
||||||
home-manager.users.christoph = import ./home/home.nix;
|
home-manager.useUserPackages =
|
||||||
|
true; # Enable installing packages through users.christoph.packages
|
||||||
|
home-manager.users.christoph = import ./home/home.nix;
|
||||||
|
|
||||||
# Make our overlays available in home.nix
|
# Make our overlays available in home.nix
|
||||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
# Make our inputs available to the configuration.nix (for importing modules)
|
# Make our inputs available to the configuration.nix (for importing modules)
|
||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit inputs; };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ rec {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# sessionPath
|
# sessionPath = [];
|
||||||
|
|
||||||
pointerCursor.package = pkgs.numix-cursor-theme;
|
pointerCursor.package = pkgs.numix-cursor-theme;
|
||||||
pointerCursor.gtk.enable = true;
|
pointerCursor.gtk.enable = true;
|
||||||
|
@ -11,7 +11,7 @@ let
|
|||||||
# We use it to determine if the config should be changed below
|
# We use it to determine if the config should be changed below
|
||||||
cfg = config.modules.emacs;
|
cfg = config.modules.emacs;
|
||||||
in {
|
in {
|
||||||
imports = [];
|
imports = [ ];
|
||||||
|
|
||||||
# Options is a vector of options this module defines
|
# Options is a vector of options this module defines
|
||||||
# This module defines only the "emacs" option and suboptions "enable" and "doom"
|
# This module defines only the "emacs" option and suboptions "enable" and "doom"
|
||||||
@ -36,9 +36,8 @@ in {
|
|||||||
# What home packages should be enabled
|
# What home packages should be enabled
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# NOTE: I have problems with emacsPgtkNativeComp/emacsPgtk and also emacs28NativeComp GUI
|
# NOTE: I have problems with emacsPgtkNativeComp/emacsPgtk and also emacs28NativeComp GUI
|
||||||
((emacsPackagesFor emacsPgtkNativeComp).emacsWithPackages (epkgs: [
|
((emacsPackagesFor emacsPgtkNativeComp).emacsWithPackages
|
||||||
epkgs.vterm
|
(epkgs: [ epkgs.vterm ]))
|
||||||
]))
|
|
||||||
|
|
||||||
binutils
|
binutils
|
||||||
zstd
|
zstd
|
||||||
@ -66,9 +65,7 @@ in {
|
|||||||
# enable = true;
|
# enable = true;
|
||||||
# };
|
# };
|
||||||
|
|
||||||
home.sessionPath = [
|
home.sessionPath = [ "/home/${config.home.username}/.emacs.d/bin" ];
|
||||||
"/home/${config.home.username}/.emacs.d/bin"
|
|
||||||
];
|
|
||||||
|
|
||||||
# We tell HomeManager where the config files belong
|
# We tell HomeManager where the config files belong
|
||||||
# home.file.".config/doom" = {
|
# home.file.".config/doom" = {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
# WARN: this file will get overwritten by $ cachix use <name>
|
# WARN: this file will get overwritten by $ cachix use <name>
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
@ -6,8 +5,9 @@ let
|
|||||||
folder = ./cachix;
|
folder = ./cachix;
|
||||||
toImport = name: value: folder + ("/" + name);
|
toImport = name: value: folder + ("/" + name);
|
||||||
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
|
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
|
||||||
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
|
imports = lib.mapAttrsToList toImport
|
||||||
|
(lib.filterAttrs filterCaches (builtins.readDir folder));
|
||||||
in {
|
in {
|
||||||
inherit imports;
|
inherit imports;
|
||||||
nix.binaryCaches = ["https://cache.nixos.org/"];
|
nix.binaryCaches = [ "https://cache.nixos.org/" ];
|
||||||
}
|
}
|
||||||
|
@ -5,13 +5,12 @@
|
|||||||
{ inputs, lib, config, pkgs, ... }:
|
{ inputs, lib, config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [ # Include the results of the hardware scan.
|
||||||
[ # Include the results of the hardware scan.
|
./hardware-configuration.nix
|
||||||
./hardware-configuration.nix
|
|
||||||
|
|
||||||
# NixCommunity binary cache
|
# NixCommunity binary cache
|
||||||
./cachix.nix
|
./cachix.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Enable flakes
|
# Enable flakes
|
||||||
# Keep nix-shell from grabage collection for direnv (keep-outputs + keep-derivations)
|
# Keep nix-shell from grabage collection for direnv (keep-outputs + keep-derivations)
|
||||||
@ -72,7 +71,8 @@
|
|||||||
enableAllFirmware = true;
|
enableAllFirmware = true;
|
||||||
enableRedistributableFirmware = true; # Also enables microcode update
|
enableRedistributableFirmware = true; # Also enables microcode update
|
||||||
|
|
||||||
nvidia.modesetting.enable = true; # Not officially supported by NVidia but needed for wayland
|
nvidia.modesetting.enable =
|
||||||
|
true; # Not officially supported by NVidia but needed for wayland
|
||||||
opengl.enable = true;
|
opengl.enable = true;
|
||||||
opengl.driSupport = true;
|
opengl.driSupport = true;
|
||||||
opengl.driSupport32Bit = true;
|
opengl.driSupport32Bit = true;
|
||||||
@ -99,10 +99,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/issues/179486
|
# https://github.com/NixOS/nixpkgs/issues/179486
|
||||||
i18n.supportedLocales = [
|
i18n.supportedLocales = [ "en_US.UTF-8/UTF-8" "de_DE.UTF-8/UTF-8" ];
|
||||||
"en_US.UTF-8/UTF-8"
|
|
||||||
"de_DE.UTF-8/UTF-8"
|
|
||||||
];
|
|
||||||
|
|
||||||
# TODO: Other ports (tcp/udp/ssh...)?
|
# TODO: Other ports (tcp/udp/ssh...)?
|
||||||
# Open ports in the firewall.
|
# Open ports in the firewall.
|
||||||
@ -118,10 +115,10 @@
|
|||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
|
|
||||||
firewall.allowedTCPPorts = [ ];
|
firewall.allowedTCPPorts = [ ];
|
||||||
firewall.allowedTCPPortRanges = [];
|
firewall.allowedTCPPortRanges = [ ];
|
||||||
|
|
||||||
firewall.allowedUDPPorts = [ ];
|
firewall.allowedUDPPorts = [ ];
|
||||||
firewall.allowedUDPPortRanges = [];
|
firewall.allowedUDPPortRanges = [ ];
|
||||||
|
|
||||||
# Or disable the firewall altogether.
|
# Or disable the firewall altogether.
|
||||||
# firewall.enable = false;
|
# firewall.enable = false;
|
||||||
@ -190,24 +187,25 @@
|
|||||||
|
|
||||||
fonts = {
|
fonts = {
|
||||||
enableDefaultFonts = true; # Some default fonts for unicode coverage
|
enableDefaultFonts = true; # Some default fonts for unicode coverage
|
||||||
fontDir.enable = true; # Puts fonts to /run/current-system/sw/share/X11/fonts
|
fontDir.enable =
|
||||||
|
true; # Puts fonts to /run/current-system/sw/share/X11/fonts
|
||||||
|
|
||||||
# Font packages go here, don't do this with HomeManager as I need the fonts in the fontdir for flatpak apps
|
# Font packages go here, don't do this with HomeManager as I need the fonts in the fontdir for flatpak apps
|
||||||
fonts = with pkgs; [
|
fonts = with pkgs; [
|
||||||
victor-mono
|
victor-mono
|
||||||
source-code-pro
|
source-code-pro
|
||||||
source-sans-pro
|
source-sans-pro
|
||||||
source-serif-pro
|
source-serif-pro
|
||||||
(pkgs.nerdfonts.override { fonts = [ "VictorMono" ]; })
|
(pkgs.nerdfonts.override { fonts = [ "VictorMono" ]; })
|
||||||
source-han-mono
|
source-han-mono
|
||||||
source-han-sans
|
source-han-sans
|
||||||
source-han-serif
|
source-han-serif
|
||||||
wqy_zenhei
|
wqy_zenhei
|
||||||
wqy_microhei
|
wqy_microhei
|
||||||
# jetbrains-mono
|
# jetbrains-mono
|
||||||
# etBook
|
# etBook
|
||||||
# overpass
|
# overpass
|
||||||
];
|
];
|
||||||
|
|
||||||
# TODO: Check if this works
|
# TODO: Check if this works
|
||||||
fontconfig = {
|
fontconfig = {
|
||||||
@ -224,7 +222,16 @@
|
|||||||
users.users.christoph = {
|
users.users.christoph = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "Christoph";
|
description = "Christoph";
|
||||||
extraGroups = [ "networkmanager" "wheel" "audio" "realtime" "docker" "adbusers" "scanner" "lp" ];
|
extraGroups = [
|
||||||
|
"networkmanager"
|
||||||
|
"wheel"
|
||||||
|
"audio"
|
||||||
|
"realtime"
|
||||||
|
"docker"
|
||||||
|
"adbusers"
|
||||||
|
"scanner"
|
||||||
|
"lp"
|
||||||
|
];
|
||||||
shell = pkgs.fish; # TODO: Is this needed if programs.fish.enable = true?
|
shell = pkgs.fish; # TODO: Is this needed if programs.fish.enable = true?
|
||||||
# We do this with HomeManager
|
# We do this with HomeManager
|
||||||
packages = with pkgs; [ ];
|
packages = with pkgs; [ ];
|
||||||
@ -277,7 +284,8 @@
|
|||||||
|
|
||||||
acpid.enable = true;
|
acpid.enable = true;
|
||||||
dbus.enable = true;
|
dbus.enable = true;
|
||||||
flatpak.enable = true; # Not quite the nix style but useful for bottles/proprietary stuff
|
flatpak.enable =
|
||||||
|
true; # Not quite the nix style but useful for bottles/proprietary stuff
|
||||||
fstrim.enable = true;
|
fstrim.enable = true;
|
||||||
fwupd.enable = true;
|
fwupd.enable = true;
|
||||||
locate.enable = true; # Periodically update index
|
locate.enable = true; # Periodically update index
|
||||||
@ -290,9 +298,7 @@
|
|||||||
autoPrune.enable = true;
|
autoPrune.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualisation.libvirtd = {
|
virtualisation.libvirtd = { enable = true; };
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
# settings for stateful data, like file locations and database versions
|
# settings for stateful data, like file locations and database versions
|
||||||
|
@ -4,11 +4,10 @@
|
|||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
boot.initrd.availableKernelModules =
|
||||||
|
[ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
@ -50,7 +49,8 @@
|
|||||||
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
|
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
hardware.cpu.intel.updateMicrocode =
|
||||||
|
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
# high-resolution display
|
# high-resolution display
|
||||||
hardware.video.hidpi.enable = lib.mkDefault true;
|
hardware.video.hidpi.enable = lib.mkDefault true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user