From bef89993685383ee09b629c32be434b6833999f7 Mon Sep 17 00:00:00 2001 From: Fabian Montero Date: Thu, 17 Mar 2022 01:05:27 -0600 Subject: [PATCH] import legacy config --- base/default.nix | 84 ++++++++++++++++++++++++++ base/hardware-configuration-custom.nix | 36 +++++++++++ flake.lock | 65 ++++++++++++++++++++ flake.nix | 23 ++++++- 4 files changed, 207 insertions(+), 1 deletion(-) create mode 100644 base/default.nix create mode 100644 base/hardware-configuration-custom.nix create mode 100644 flake.lock diff --git a/base/default.nix b/base/default.nix new file mode 100644 index 0000000..1ed34bd --- /dev/null +++ b/base/default.nix @@ -0,0 +1,84 @@ +# Edet 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, lib, ... }: +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration-custom.nix + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "posixlycorrect"; # Define your hostname. + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "America/Costa_Rica"; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = false; + networking.interfaces.enp7s0.useDHCP = true; + networking.interfaces.wlp6s0.useDHCP = true; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "us"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; # quitar luego + + + # Enable the Plasma 5 Desktop Environment. + services.xserver.displayManager.sddm.enable = true; # quitar luego + services.xserver.desktopManager.plasma5.enable = true; # quitar luego + + + # Configure keymap in X11 + services.xserver.layout = "us"; + + # Enable sound. + sound.enable = true; + hardware.pulseaudio.enable = true; + + services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. # quitar esto + users.users.host = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + }; + + users.users.temp = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + }; + + nixpkgs.config.allowUnfree = true; + + users.users.temp.packages = with pkgs; [ firefox jetbrains.pycharm-professional neovim git tdesktop python310 gcc discord xournalpp zoom-us jq zip unzip signal-desktop verilog vscodium pipenv runelite calc units vlc file btrfs-progs ]; + + + nix = { + package = pkgs.nixFlakes; + extraOptions = '' + experimental-features = nix-command flakes + ''; + }; + + + services.openssh.enable = true; + + # NO TOCAR ESTO + system.stateVersion = "21.11"; # Did you read the comment? + +} + diff --git a/base/hardware-configuration-custom.nix b/base/hardware-configuration-custom.nix new file mode 100644 index 0000000..28a6153 --- /dev/null +++ b/base/hardware-configuration-custom.nix @@ -0,0 +1,36 @@ +{ config, lib, pkgs, modulesPath, ... }: let + + subvol = subvol: { + device = "/dev/disk/by-uuid/645fdba0-5c03-4285-926b-facded1ee259"; + fsType = "btrfs"; + options = [ "subvol=${subvol}" "compress=zstd" "noatime" "ssd" ]; + }; + +in { + + imports = + [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd = { + availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + luks.devices."toplevel" = { + device = "/dev/disk/by-uuid/58277baa-90d4-4a5e-a658-1b918b89130a"; + preLVM = false; + }; + }; + + fileSystems = { + "/" = subvol "root"; + "/toplevel" = subvol "/"; + "/boot" = { + device = "/dev/disk/by-uuid/98C2-560B"; + fsType = "vfat"; + options = ["umask=027"]; + }; + }; + + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..e489a0c --- /dev/null +++ b/flake.lock @@ -0,0 +1,65 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1647175256, + "narHash": "sha256-7H+veXPM7IwdN1DoZqliwb9sghlN56koV5dnCu1kpsc=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "a8d00f5c038cf7ec54e7dac9c57b171c1217f008", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-21.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1647282937, + "narHash": "sha256-K8Oo6QyFCfiEWTRpQVfzcwI3YNMKlz6Tu8rr+o3rzRQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "64fc73bd74f04d3e10cb4e70e1c65b92337e76db", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-21.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nur": { + "locked": { + "lastModified": 1647490150, + "narHash": "sha256-nm3Gq9l1CZvULeh//nfAU92ArTGdNkujK0sx7V8Skn8=", + "owner": "nix-community", + "repo": "NUR", + "rev": "5ca0d7841ce7f56af23dea10355ea914b0bf991d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "nur": "nur" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 0967ef4..063e210 100644 --- a/flake.nix +++ b/flake.nix @@ -1 +1,22 @@ -{} +{ + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11"; + nur.url = "github:nix-community/NUR"; + + home-manager = { + url = "github:nix-community/home-manager/release-21.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = {self, nixpkgs, home-manager, nur, ...}: { + nixosConfigurations.posixlycorrect = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ ( import ./base ) ]; + }; + + homeConfigurations."fabian@posixlycorrect" = {}; + }; + +}