Initial Config Commit

master
Chan Wen Xu 2021-09-11 20:05:37 +07:00
parent 001ed751f2
commit ac6e741037
9 changed files with 269 additions and 0 deletions

@ -0,0 +1,28 @@
{ config, pkgs, lib, ... }:
{
nix.buildCores = 1;
nix.maxJobs = 2;
nixpkgs.config.allowUnfree = true;
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/97b23bd6-cca7-499c-9589-a74ce3205731";
boot.loader.grub = {
enable = true;
version = 2;
device = "/dev/sda";
useOSProber = true;
};
networking = {
hostName = "aspire";
# useDHCP is deprecated, disable explicitly.
useDHCP = false;
interfaces.enp2s0f0.useDHCP = true;
};
services.xserver.libinput.enable = true;
system.stateVersion = "21.05";
}

@ -0,0 +1,43 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "xhci_pci" "usb_storage" "usbhid" "sd_mod" "sr_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" "wl" ];
boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/3a5d1853-d44b-4483-b964-62ef2ad25d06";
fsType = "btrfs";
options = [ "subvol=@" ];
};
fileSystems."/persist" =
{ device = "/dev/disk/by-uuid/3a5d1853-d44b-4483-b964-62ef2ad25d06";
fsType = "btrfs";
options = [ "subvol=@persist" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/3a5d1853-d44b-4483-b964-62ef2ad25d06";
fsType = "btrfs";
options = [ "subvol=@nix" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/2e235b61-281c-481e-936a-918653d2dd06";
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/1ba34ba4-5007-4669-a7eb-78e516d2d29c"; }
];
}

@ -0,0 +1,60 @@
{ self, home-manager, ... }:
{ config, pkgs, lib, ... }:
{
imports = [
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.chanbakjsd = import ../home/home.nix;
}
];
nix.package = pkgs.nixUnstable;
nix.extraOptions = "experimental-features = nix-command flakes";
nixpkgs.config.allowUnfree = true;
nixpkgs.config.packageOverrides = pkgs: {
os-prober = pkgs.os-prober.overrideAttrs (ori: {
patches = [ ./pkg/os-prober.patch ]; # OS Prober is awfully slow in detecting Linux distros.
});
};
environment.systemPackages = with pkgs; [
firefox
git
git-crypt
vim
];
fonts.fonts = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
jetbrains-mono
];
sound.enable = true;
hardware.pulseaudio.enable = true;
time.timeZone = "Asia/Kuala_Lumpur";
networking.networkmanager.enable = true;
networking.dhcpcd.wait = "background"; # Don't wait and immediately go to background.
services.xserver = {
enable = true;
displayManager.sddm.enable = true;
windowManager.i3.enable = true;
};
users = {
mutableUsers = false; # Force all users to be declared
users.chanbakjsd = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
hashedPassword = self.secrets.passwordHash;
};
};
}

@ -0,0 +1,47 @@
From f55729aa2b44bb31f44ea7293e359d035eeb4b31 Mon Sep 17 00:00:00 2001
From: Chan Wen Xu <lutherchanpublic+git@gmail.com>
Date: Sat, 11 Sep 2021 15:47:29 +0800
Subject: [PATCH 1/1] Skip expensive call
---
os-probes/mounted/common/90linux-distro | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/os-probes/mounted/common/90linux-distro b/os-probes/mounted/common/90linux-distro
index 41a5553..cac2368 100755
--- a/os-probes/mounted/common/90linux-distro
+++ b/os-probes/mounted/common/90linux-distro
@@ -17,7 +17,9 @@ type="$3"
# symlinks we need to also check in $dir/usr/lib* for distributions that
# moved /lib* to /usr and only left symlinks behind.
# TODO: look for ld-linux.so on arches that have it
-if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null; then
+
+# Avoid expensive search, don't have exotic distros anyways.
+# if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null; then
if [ -e "$dir/etc/os-release" ]; then
short="$(grep ^NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g; s/[[:space:]].*//')"
long="$(grep ^PRETTY_NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g')"
@@ -141,13 +143,14 @@ if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*)
short="Exherbo"
long="Exherbo Linux"
else
- short="Linux"
- long="unknown Linux distribution"
+ exit 1
+ # short="Linux"
+ # long="unknown Linux distribution"
fi
label="$(count_next_label "$short")"
result "$partition:$long:$label:linux"
exit 0
-else
- exit 1
-fi
+# else
+# exit 1
+# fi
--
2.32.0

@ -0,0 +1,48 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1631134124,
"narHash": "sha256-C17wJ2HyuFZllJ/PbpFuuDjkzWvg8np9UIAdSrpuwS0=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "039f786e609fdb3cfd9c5520ff3791750c3eaebf",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1631295156,
"narHash": "sha256-jIriDkYUU09njpjvpRiS2/Yy+iKpmalCGJ2HnC41ZSQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "bbbe2b35f736d039884e082ecc6d6e631e126029",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

@ -0,0 +1,23 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, home-manager, ... }@inputs:
{
nixosConfigurations = {
aspire = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
(import ./config/common.nix inputs)
./config/aspire.nix
./config/aspire_hardware.nix
];
};
};
secrets = import ./secrets/secrets.nix;
};
}

@ -0,0 +1,12 @@
{ self, pkgs, ... }:
{
services.polybar = {
enable = true;
script = "polybar bar &";
};
xsession.windowManager.i3 = {
enable = true;
config = import ./i3.nix;
};
}

@ -0,0 +1,8 @@
{
fonts = {
names = [ "JetBrains Mono" ];
size = 12.0;
};
modifier = "Mod4";
}

Binary file not shown.