zephyrus: init host

This commit is contained in:
Antoine Martin 2021-07-23 18:47:53 +02:00
parent d7387374da
commit cbd98189e2
5 changed files with 181 additions and 0 deletions

View file

@ -118,6 +118,26 @@
]; ];
}; };
zephyrus = nixpkgs.lib.nixosSystem rec {
inherit system;
modules = [
./zephyrus.nix
home-manager.nixosModule
self.nixosModules.home
{
nixpkgs.overlays = [
inputs.emacs-overlay.overlay
(self: super: {
steam = self.unstable.steam;
})
] ++ shared_overlays;
}
];
};
}; };
} // inputs.flake-utils.lib.eachDefaultSystem (system: { } // inputs.flake-utils.lib.eachDefaultSystem (system: {
packages = packages =

View file

@ -0,0 +1,63 @@
# Edit 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, lib, pkgs, ... }:
let
secrets = config.my.secrets;
in
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./home.nix
];
boot.kernelPackages = pkgs.linuxPackages_latest;
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
services.btrfs = {
autoScrub = {
enable = true;
fileSystems = [ "/" ];
};
};
networking.hostName = "zephyrus"; # Define your hostname.
networking.domain = "alarsyo.net";
# Set your time zone.
time.timeZone = "Europe/Paris";
# 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.interfaces.enp0s31f6.useDHCP = true;
networking.interfaces.wlp0s20f3.useDHCP = true;
# List services that you want to enable:
my.services = {
tailscale.enable = true;
pipewire.enable = true;
};
services = {
xserver = {
enable = true;
windowManager.i3.enable = true;
layout = "fr";
xkbVariant = "us";
libinput.enable = true;
};
};
my.displayManager.sddm.enable = true;
hardware.bluetooth = {
enable = true;
powerOnBoot = false;
};
}

View file

@ -0,0 +1,44 @@
# 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" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/6395cef1-c30b-450a-917c-cfb3c0380642";
fsType = "btrfs";
options = [ "subvol=@" "compress=zstd" "noatime" ];
};
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/c59e7067-e33c-474c-9b8e-96d0e8f59297";
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/6395cef1-c30b-450a-917c-cfb3c0380642";
fsType = "btrfs";
options = [ "subvol=@home" "compress=zstd" "noatime" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/6395cef1-c30b-450a-917c-cfb3c0380642";
fsType = "btrfs";
options = [ "subvol=@nix" "compress=zstd" "noatime" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/D9DA-F46C";
fsType = "vfat";
};
swapDevices = [ ];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}

26
hosts/zephyrus/home.nix Normal file
View file

@ -0,0 +1,26 @@
{ config, pkgs, ... }:
{
home-manager.users.alarsyo = {
# Keyboard settings & i3 settings
my.home.x.enable = true;
my.home.x.cursor.enable = true;
my.home.alacritty.enable = true;
my.home.emacs.enable = true;
my.home.tmux.enable = true;
my.home.starship.enable = false;
my.home.fish.enable = true;
my.theme = config.home-manager.users.alarsyo.my.themes.solarizedLight;
home.packages = with pkgs; [
# some websites only work there :(
chromium
# dev
rustup
unstable.beancount
unstable.fava
];
};
}

28
zephyrus.nix Normal file
View file

@ -0,0 +1,28 @@
{ ... }:
{
imports = [
# Default configuration
./base
./base/gui-programs.nix
# Module definitions
./modules
# Service definitions
./services
# Configuration secrets
./secrets
# Host-specific config
./hosts/zephyrus
];
# 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. Its 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
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.05"; # Did you read the comment?
}