Enable audio and add a basic home configuration

This commit is contained in:
coolneng 2020-05-09 01:17:35 +02:00
parent f4e7147105
commit 3b65c57b30
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
7 changed files with 193 additions and 10 deletions

View File

@ -4,7 +4,6 @@
# Kernel configuration
boot = {
kernelPackages = pkgs.linuxPackages_latest;
# TODO Add resume_offset
kernelParams = [ "zfs.zfs_arc_max=536870912" ];
kernelModules = [ "i915" "acpi_call" ];
extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];
@ -64,13 +63,17 @@
# Enable the TLP daemon
services.tlp.enable = true;
# Add a swap file and resume from it
swapDevices = [ { device = "/swap"; size = 8192; } ];
boot.resumeDevice = "/swap";
# NixOS version
system.stateVersion = "20.09";
# Create coolneng user
users.users.coolneng = {
isNormalUser = true;
home = "/home/coolneng";
extraGroups = [ "wheel" "video" "audio" ];
shell = "/run/current-system/sw/bin/fish";
};
# Import other configuration modules
imports = [
./modules/software.nix
@ -78,6 +81,8 @@
./modules/gui.nix
./modules/datasync.nix
./modules/audio.nix
./modules/home.nix
./modules/hardware-configuration.nix
];
}

15
modules/audio.nix Normal file
View File

@ -0,0 +1,15 @@
{ config, lib, pkgs, ... }:
{
# Enable ALSA
sound.enable = true;
# Configure PulseAudio with mopidy tweaks
hardware.pulseaudio = {
enable = true;
tcp = {
enable = true;
anonymousClients.allowedIpRanges = [ "127.0.0.1" ];
};
};
}

View File

@ -19,6 +19,7 @@
dataset = "syscea/root";
};
};
"syscea/state/home" = {
plan = "1d=>1h,1m=>1d,1y=>1m";
recursive = true;

View File

@ -2,11 +2,12 @@
{
# Display manager
services.xserver.enable = true;
services.xserver.displayManager = {
defaultSession = "sway";
sddm = {
enable = true;
autologin = {
autoLogin = {
enable = true;
user = "coolneng";
};
@ -47,9 +48,13 @@
enable = true;
temperature = {
day = 6500;
night = 5500;
night = 5000;
};
};
location = {
latitude = 35.89;
longitude = -5.32;
};
# Bar
programs.waybar.enable = true;

View File

@ -0,0 +1,46 @@
# 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 = [ "xhci_pci" "ahci" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "syscea/stateful/root";
fsType = "zfs";
};
fileSystems."/nix" =
{ device = "syscea/ephemeral/nix";
fsType = "zfs";
};
fileSystems."/tmp" =
{ device = "syscea/ephemeral/tmp";
fsType = "zfs";
};
fileSystems."/home" =
{ device = "syscea/stateful/home";
fsType = "zfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/4AED-6F54";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/29d26e6a-b421-41c3-9826-76e4da00e3bb"; }
];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}

111
modules/home.nix Normal file
View File

@ -0,0 +1,111 @@
{ config, lib, pkgs, ... }:
# Doom emacs overlay
let
doom-emacs = pkgs.callPackage (builtins.fetchTarball {
url = https://github.com/vlaci/nix-doom-emacs/archive/master.tar.gz;
}) {
doomPrivateDir = ./doom.d;
};
in
{
# User packages
home.packages = [
# Text editors
doom-emacs
pkgs.neovim
# Terminals
pkgs.tmux
pkgs.tmuxp
# Development
pkgs.git
pkgs.direnv
pkgs.lorri
];
# Enable home manager
programs.home-manager.enable = true;
# Terminal emulator
programs.kitty = {
enable = true;
font.name = "Go Mono 11";
settings = {
repaint_delay = 30;
input_delay = 10;
enable_audio_bell = false;
foreground = "#c6c8d1";
background = "#161821";
color0 = "#161821";
color8 = "#6b7089";
color1 = "#e27878";
color9 = "#e98989";
color2 = "#b4be82";
color10= "#c0ca8e";
color3 = "#e2a478";
color11= "#e9b189";
color4 = "#84a0c6";
color12= "#91acd1";
color5 = "#a093c7";
color13= "#ada0d3";
color6 = "#89b8c2";
color14= "#95c4ce";
color7 = "#c6c8d1";
color15= "#d2d4de";
};
};
# Shell
home.sessionVariables = {
# fff colors [0-9]
FFF_COL1 = 4;
FFF_COL2 = 8;
# fff favourites;
FFF_FAV1 = "$HOME/Documents/Uni";
FFF_FAV2 = "$HOME/Documents/Papers";
FFF_FAV3 = "$HOME/Documents/Books/Academic";
FFF_FAV4 = "$HOME/Documents/Education";
};
programs.fish = {
enable = true;
shellAbbrs = {
la = "ls -lA";
f = "fff";
vim = "nvim";
};
shellAliases = {
wlan = "iw dev wlp2s0 scan | grep SSID";
bc = "bc -l";
docker = "podman";
docker-compose = "podman-compose";
};
plugins = [
{
name = "colored-man";
src = builtins.fetchGit {
name = "fish-colored-man";
url = "https://github.com/decors/fish-colored-man";
rev = "c1e9db7765c932587b795d6c8965e9cff2fd849a";
};
}
{
name = "prompt-theme";
src = builtins.fetchGit {
name = "fish-colored-man";
url = "https://github.com/oh-my-fish/theme-nai";
rev = "9616e644e95fe79eb59b8c9d77fe44b9f096db2f";
};
}
];
};
# Emacs startup
home.file.".emacs.d/init.el".text = ''
(load "default.el")
'';
}

View File

@ -12,9 +12,10 @@
firefox
chromium
# LaTeX
texlive.combind.scheme-full
texlive.combined.scheme-full
pandoc
pandoc-citeproc
# Declarative user config
home-manager
];
# Fonts declaration
@ -24,7 +25,6 @@
siji
cherry
iosevka
emacs.all-the-icons-fonts
];
};