-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit. Functional flake configuration prototype.
- Loading branch information
0 parents
commit 675efb2
Showing
26 changed files
with
875 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
**/.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ lib, pkgs, ... } @ args: let | ||
|
||
inherit (lib) mkDefault; | ||
|
||
in { | ||
|
||
# Whether to use NetworkManager to obtain an IP address and other configuration for all network interfaces that are not manually configured. | ||
# If enabled, a group 'networkmanager' will be created. Add all users that should have permission to change network settings to this group. | ||
networking.networkmanager.enable = mkDefault true; | ||
networking.useDHCP = mkDefault true; | ||
|
||
# Enable the firewall by default. | ||
networking.firewall.enable = mkDefault true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Here we define the shared system-wide configuration for each and every host. | ||
{ lib, pkgs, ... } @ args: let | ||
|
||
inherit (lib) mkDefault; | ||
|
||
in { | ||
|
||
imports = [ ./networking.nix ]; | ||
|
||
# Don't install the docs in the system. See: https://nixos.org/manual/nixos/stable/ | ||
documentation.nixos.enable = mkDefault false; | ||
nixpkgs.config.allowUnfree = mkDefault true; | ||
|
||
# Settings to use for the different TTY's. | ||
console = { | ||
|
||
earlySetup = mkDefault true; | ||
keyMap = mkDefault "es"; | ||
|
||
packages = with pkgs; [ terminus_font ]; | ||
font = "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz"; | ||
}; | ||
|
||
# At least an editor to edit the configuration. | ||
environment.systemPackages = with pkgs; [ nano ]; | ||
environment.variables = { | ||
|
||
EDITOR = "nano"; | ||
VISUAL = "nano"; | ||
}; | ||
|
||
# Use English as language but Spanish units and currencies. | ||
i18n.defaultLocale = mkDefault "en_US.UTF-8"; | ||
i18n.extraLocaleSettings = { | ||
|
||
LC_NAME = mkDefault "es_ES.UTF-8"; | ||
LC_TIME = mkDefault "es_ES.UTF-8"; | ||
LC_PAPER = mkDefault "es_ES.UTF-8"; | ||
LC_ADDRESS = mkDefault "es_ES.UTF-8"; | ||
LC_NUMERIC = mkDefault "es_ES.UTF-8"; | ||
LC_MONETARY = mkDefault "es_ES.UTF-8"; | ||
LC_TELEPHONE = mkDefault "es_ES.UTF-8"; | ||
LC_MEASUREMENT = mkDefault "es_ES.UTF-8"; | ||
LC_IDENTIFICATION = mkDefault "es_ES.UTF-8"; | ||
}; | ||
|
||
# Only allow 'wheel' group members to use sudo. | ||
security.sudo.enable = mkDefault true; | ||
security.sudo.execWheelOnly = mkDefault true; | ||
|
||
# Avoid problems if dual-booting with Windows. | ||
time.hardwareClockInLocalTime = mkDefault true; | ||
time.timeZone = mkDefault "Europe/Madrid"; | ||
|
||
# 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. | ||
# It‘s 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. | ||
system.stateVersion = mkDefault "23.05"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
username = "guest"; | ||
fullName = "Guest"; | ||
|
||
restrictRootAccess = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
username = "iivvaannxx"; | ||
fullName = "Ivan Porto Wigner"; | ||
email = "[email protected]"; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
description = "My personal NixOS Flake system configuration."; | ||
inputs = { | ||
|
||
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; | ||
unstablepkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | ||
|
||
home-manager = { | ||
|
||
url = "github:nix-community/home-manager/release-23.05"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
}; | ||
|
||
outputs = { nixpkgs, unstablepkgs, home-manager, ... } @ inputs: let | ||
|
||
# The systems where this flake was tested. | ||
testedSystems = { | ||
|
||
x86_64-linux = "x86_64-linux"; | ||
}; | ||
|
||
# Extend the default library with our own set of functions. | ||
lib = (nixpkgs.lib.extend (import ./overlays/lib.nix)) // home-manager.lib; | ||
|
||
# Creates a host using the configuration in the given path. | ||
createHost = hostPath: system: lib.custom.mkHost { | ||
|
||
inherit system hostPath inputs; | ||
|
||
modules = import ./modules; | ||
extraArgs = { }; | ||
}; | ||
|
||
in { | ||
|
||
nixosConfigurations = { | ||
|
||
# Home Desktop Computer. | ||
desktop = createHost ./hosts/desktop testedSystems.x86_64-linux; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ config, lib, pkgs, modulesPath, ... } @ args: let | ||
|
||
in { | ||
|
||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; | ||
|
||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; | ||
boot.initrd.kernelModules = [ ]; | ||
boot.kernelModules = [ "kvm-intel" ]; | ||
boot.extraModulePackages = [ ]; | ||
|
||
fileSystems."/" = { | ||
|
||
device = "/dev/disk/by-uuid/745067bc-0dec-42bc-b85e-10c273a7bd2d"; | ||
fsType = "ext4"; | ||
}; | ||
|
||
fileSystems."/boot" = { | ||
|
||
device = "/dev/disk/by-uuid/FC14-3DD4"; | ||
fsType = "vfat"; | ||
}; | ||
|
||
swapDevices = [ ]; | ||
|
||
modules.hardware.nvidia.enable = true; | ||
modules.hardware.nvidia.tryFixTearing = true; | ||
|
||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; | ||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; | ||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ config, lib, pkgs, ... } @ args: let | ||
|
||
in { | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ config, lib, inputs, pkgs, upkgs, ... } @ args: let | ||
|
||
inherit (lib.custom) importCommonConfig; | ||
|
||
# The base configuration for every system. | ||
commonSystemConfig = importCommonConfig "system"; | ||
|
||
in { | ||
|
||
imports = [ | ||
|
||
./hardware.nix | ||
./networking.nix | ||
|
||
commonSystemConfig | ||
]; | ||
|
||
# Boot configuration. | ||
boot.loader.timeout = 10; | ||
boot.loader.efi.canTouchEfiVariables = true; | ||
|
||
# Use systemd-boot as the default bootloader. See: https://nixos.wiki/wiki/Bootloader | ||
boot.loader.systemd-boot = { | ||
|
||
enable = true; | ||
editor = false; | ||
configurationLimit = 5; | ||
}; | ||
|
||
modules.security.root.useDoasInsteadOfSudo = true; | ||
|
||
services.xserver.enable = true; | ||
services.xserver.displayManager.gdm.enable = true; | ||
services.xserver.desktopManager.gnome.enable = true; | ||
services.xserver.excludePackages = [ pkgs.xterm ]; | ||
services.xserver.desktopManager.xterm.enable = false; | ||
|
||
# Configure keymap in X11 | ||
services.xserver = { | ||
|
||
layout = "es"; | ||
xkbVariant = ""; | ||
}; | ||
|
||
services.gnome.core-utilities.enable = false; | ||
environment.gnome.excludePackages = (with pkgs; [ | ||
|
||
gnome-tour | ||
]); | ||
|
||
services.printing.enable = false; | ||
sound.enable = true; | ||
|
||
hardware.pulseaudio.enable = false; | ||
|
||
security.rtkit.enable = true; | ||
services.pipewire = { | ||
|
||
enable = true; | ||
alsa.enable = true; | ||
alsa.support32Bit = true; | ||
pulse.enable = true; | ||
}; | ||
|
||
nixpkgs.config.allowUnfree = true; | ||
environment.systemPackages = with pkgs; [ | ||
|
||
gnome.nautilus | ||
gnome.seahorse | ||
gnome.dconf-editor | ||
gnome.gnome-tweaks | ||
]; | ||
|
||
programs._1password-gui.enable = true; | ||
programs._1password-gui.polkitPolicyOwners = [ "iivvaannxx" ]; | ||
|
||
nix = { | ||
|
||
package = pkgs.nixFlakes; | ||
extraOptions = "experimental-features = nix-command flakes"; | ||
|
||
settings = { | ||
|
||
auto-optimise-store = true; | ||
}; | ||
|
||
gc = { | ||
|
||
automatic = true; | ||
dates = "weekly"; | ||
|
||
options = "--delete-older-than-7d"; | ||
}; | ||
}; | ||
} |
Oops, something went wrong.