Skip to content

Commit

Permalink
Break configuration into meaningful chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
ners committed Apr 18, 2021
1 parent bba4da8 commit c398bb8
Show file tree
Hide file tree
Showing 11 changed files with 253 additions and 195 deletions.
24 changes: 24 additions & 0 deletions bootloader.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ config, pkgs, ... }:
{
fileSystems."/boot/efi" = {
device = "/dev/disk/by-label/EFI";
fsType = "vfat";
};

boot.loader = {
systemd-boot.enable = true;
timeout = 3;
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi";
};
grub = {
device = "nodev";
efiSupport = true;
enable = true;
fsIdentifier = "label";
gfxmodeEfi = "1920x1080";
theme = pkgs.nixos-grub2-theme;
};
};
}
27 changes: 27 additions & 0 deletions btrfs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{ config, pkgs, ... }:
{
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NixOS";
fsType = "btrfs";
options = [ "subvol=root" "compress=zstd" ];
};
"/home" = {
device = "/dev/disk/by-label/NixOS";
fsType = "btrfs";
options = [ "subvol=home" "compress=zstd" ];
};
"/swap" = {
device = "/dev/disk/by-label/NixOS";
fsType = "btrfs";
options = [ "subvol=swap" "compress=no" ];
};
};

swapDevices = [ { device = "/swap/swapfile"; size = 4096; } ];

environment.systemPackages = with pkgs; [
btrfs-progs
compsize
];
}
149 changes: 9 additions & 140 deletions configuration.nix
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
{ config, pkgs, ... }:

let
unstableTarball = fetchTarball https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz;
unstableOverride = import ( unstableTarball ) { config = config.nixpkgs.config; };
mozillaTarball = fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz;
mozillaOverlay = import ( mozillaTarball );
in
{
imports = [
./hardware-configuration.nix
./bootloader.nix
./btrfs.nix
./dvorak.nix
./firefox-nightly.nix
./gnome.nix
./hardware-configuration.nix
./pipewire.nix
./selinux.nix
./sway.nix
./vim.nix
./virtualisation.nix
./zsh.nix
];

boot.kernelPackages = pkgs.linuxPackages_latest;
boot.loader.grub = {
device = "nodev";
efiSupport = true;
enable = true;
fsIdentifier = "label";
gfxmodeEfi = "1920x1080";
theme = pkgs.nixos-grub2-theme;
};

nix = {
autoOptimiseStore = true;
gc = {
Expand All @@ -42,19 +33,8 @@ in
nixpkgs.config = {
allowUnfree = true;
allowBroken = false;
packageOverrides = pkgs: {
unstable = unstableOverride;
};
firefox = {
# enableAdobeFlash = true;
enableGnomeExtensions = true;
};
};

nixpkgs.overlays = [
mozillaOverlay
];

networking = {
hostName = "nixos";
networkmanager.enable = true;
Expand All @@ -73,29 +53,9 @@ in
xserver = {
enable = true;
videoDrivers = [ "nouveau" ];
displayManager = {
gdm = {
enable = true;
wayland = true;
};
};
desktopManager.gnome3.enable = true;
xkbOptions = "caps:escape";
libinput.enable = true;
};
gnome3 = {
core-os-services.enable = true;
core-shell.enable = true;
};
pipewire = {
enable = true;
#Coming in 21.05:
#media-session.enable = true;
#alsa.enable = true;
#alsa.support32Bit = true;
#pulse.enable = true;
#jack.enable = true;
};
flatpak.enable = true;
fprintd.enable = true;
fwupd.enable = true;
Expand All @@ -104,12 +64,6 @@ in
printing.enable = true;
redshift.enable = true;
};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-wlr ];
};

systemd.package = pkgs.systemd.override { withSelinux = true; };

security = {
rtkit.enable = true;
Expand All @@ -119,14 +73,6 @@ in
};
};

virtualisation = {
podman.enable = true;
libvirtd.enable = true;
};

sound.enable = true;
powerManagement.enable = true;

users = {
users.root = {
initialHashedPassword = "";
Expand All @@ -142,113 +88,36 @@ in
environment = {
systemPackages = with pkgs; [
aria2
direnv
entr
exfat
expect
file
flatpak-builder
fprintd
gitAndTools.gitFull
gnome3.adwaita-icon-theme
gnome3.gnome-tweak-tool
gnome3.networkmanagerapplet
gnomeExtensions.appindicator
gnumake
grml-zsh-config
htop
httpie
jq
killall
libappindicator
libsecret
libselinux
moreutils
mpv
neovim
neovim-qt
nix-direnv
nix-index
nix-zsh-completions
nodejs
pciutils
pipewire
policycoreutils
pv
qjackctl
silver-searcher
sshfs-fuse
starship
subversion
tio
tmux
tree
# firefox-wayland
latest.firefox-nightly-bin
unstable.vimPlugins.vim-nerdtree-syntax-highlight
usbutils
vimPlugins.base16-vim
vimPlugins.coc-git
vimPlugins.coc-nvim
vimPlugins.haskell-vim
vimPlugins.nerdtree
vimPlugins.sved
vimPlugins.vim-devicons
vimPlugins.vim-nix
virt-manager
wget
wineWowPackages.stable
winetricks
yaru-theme
zsh
zsh-autosuggestions
zsh-completions
zsh-syntax-highlighting
];
variables = {
EDITOR = "nvim";
VISUAL = "nvim-qt";
};
pathsToLink = [ "/share/nix-direnv" ];
};

fonts = {
fontconfig.enable = true;
enableFontDir = true;
enableGhostscriptFonts = true;
fonts = with pkgs; [
(nerdfonts.override { fonts = [ "RobotoMono" ]; })
corefonts
dejavu_fonts
inconsolata
inter
inter-ui
noto-fonts
noto-fonts-emoji
noto-fonts-extra
roboto
roboto-mono
source-code-pro
source-sans-pro
source-serif-pro
carlito
];
fontconfig.defaultFonts = {
sansSerif = ["Arimo"];
serif = ["Tinos"];
monospace = ["Cousine"];
emoji = ["Noto Color Emoji"];
};
};

programs = {
dconf.enable = true;
mtr.enable = true;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
nm-applet.enable = true;
};

networking.firewall.enable = false;
Expand Down
16 changes: 16 additions & 0 deletions firefox-nightly.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ config, pkgs, ... }:

let
mozillaTarball = fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz;
mozillaOverlay = import ( mozillaTarball );
in
{
nixpkgs.overlays = [
mozillaOverlay
];

environment.systemPackages = with pkgs; [
# firefox-wayland
latest.firefox-nightly-bin
];
}
69 changes: 69 additions & 0 deletions gnome.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
gnome3.adwaita-icon-theme
gnome3.gnome-tweak-tool
gnome3.networkmanagerapplet
gnomeExtensions.appindicator
libappindicator
yaru-theme
];

services = {
xserver = {
displayManager.gdm = {
enable = true;
wayland = true;
};
desktopManager.gnome3.enable = true;
};
gnome3 = {
core-os-services.enable = true;
core-shell.enable = true;
};
};

fonts = {
fontconfig.enable = true;
enableFontDir = true;
enableGhostscriptFonts = true;
fonts = with pkgs; [
(nerdfonts.override { fonts = [ "RobotoMono" ]; })
corefonts
dejavu_fonts
inconsolata
inter
inter-ui
noto-fonts
noto-fonts-emoji
noto-fonts-extra
roboto
roboto-mono
source-code-pro
source-sans-pro
source-serif-pro
carlito
];
fontconfig.defaultFonts = {
sansSerif = ["Arimo"];
serif = ["Tinos"];
monospace = ["Cousine"];
emoji = ["Noto Color Emoji"];
};
};

xdg.portal = {
enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-wlr ];
};

programs = {
dconf.enable = true;
mtr.enable = true;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
nm-applet.enable = true;
};
}
Loading

0 comments on commit c398bb8

Please sign in to comment.