Add framework
This commit is contained in:
parent
099b6ffa28
commit
25ab9e9b70
23
flake.nix
23
flake.nix
|
@ -178,6 +178,29 @@
|
|||
}
|
||||
];
|
||||
};
|
||||
# framework configuration
|
||||
nixosConfigurations."nki-framework" = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
(common-nixos nixpkgs)
|
||||
# inputs.lanzaboote.nixosModules.lanzaboote
|
||||
({ ... }: {
|
||||
# Sets up secure boot
|
||||
# boot.loader.systemd-boot.enable = lib.mkForce false;
|
||||
# boot.lanzaboote = {
|
||||
# enable = true;
|
||||
# pkiBundle = "/etc/secureboot";
|
||||
# };
|
||||
})
|
||||
./nki-framework/configuration.nix
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.nki = import ./home/nki-framework.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
# macbook nixos
|
||||
nixosConfigurations."kagami-air-m1" = inputs.nixpkgs.lib.nixosSystem rec {
|
||||
system = "aarch64-linux";
|
||||
|
|
|
@ -169,7 +169,7 @@ in
|
|||
hash =
|
||||
if pkgs.stdenv.isDarwin
|
||||
then lib.fakeHash
|
||||
else "sha256-xr43ejHGCH4mcjOqxTJpO11LWKcHKAEETt6ZWUG9vo4=";
|
||||
else "sha256-Q8KSI8H7+d/sUdSlcNAiOPn2THKk7SFqC3U7rLqSqtE=";
|
||||
leaveDotGit = true;
|
||||
};
|
||||
in
|
||||
|
@ -187,7 +187,7 @@ in
|
|||
sha256 =
|
||||
if pkgs.stdenv.isDarwin
|
||||
then "sha256-lW3E4gSZV/m2RfofUqeiCu8KDz06YEvXbYKs8smXFi4="
|
||||
else "sha256-nocX9L8vD655nzky4PQulygWAjKGC1rh3SYDr7t4wBQ=";
|
||||
else "sha256-H5Z4vPTZCFxDCWguOB8oVSGPJyQonrD8FWAQZTYPG2U=";
|
||||
leaveDotGit = true;
|
||||
};
|
||||
in
|
||||
|
|
|
@ -3,6 +3,11 @@
|
|||
let
|
||||
monitors = {
|
||||
# Internal
|
||||
"framework" = {
|
||||
name = "BOE 0x0BCA Unknown";
|
||||
mode = "2256x1504@60Hz";
|
||||
scale = 1.25;
|
||||
};
|
||||
# External
|
||||
## Work @ EPFL
|
||||
"work" = {
|
||||
|
|
90
home/nki-framework.nix
Normal file
90
home/nki-framework.nix
Normal file
|
@ -0,0 +1,90 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# Common configuration
|
||||
./common.nix
|
||||
# We use our own firefox
|
||||
# ./firefox.nix
|
||||
# osu!
|
||||
./osu.nix
|
||||
];
|
||||
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home.username = "nki";
|
||||
home.homeDirectory = "/home/nki";
|
||||
|
||||
# More packages
|
||||
home.packages = (with pkgs; [
|
||||
# CLI stuff
|
||||
python3
|
||||
zip
|
||||
# TeX
|
||||
texlive.combined.scheme-full
|
||||
# Note-taking
|
||||
rnote
|
||||
|
||||
# Java & sbt
|
||||
jdk19
|
||||
]);
|
||||
|
||||
# Graphical set up
|
||||
linux.graphical.type = "wayland";
|
||||
linux.graphical.wallpaper = ./images/wallpaper_0.png;
|
||||
linux.graphical.defaults.webBrowser = "librewolf.desktop";
|
||||
# Enable sway
|
||||
programs.my-sway.enable = true;
|
||||
programs.my-sway.fontSize = 14.0;
|
||||
programs.my-sway.terminal = "${config.programs.kitty.package}/bin/kitty";
|
||||
programs.my-sway.browser = "librewolf";
|
||||
wayland.windowManager.sway.config = {
|
||||
# Keyboard support
|
||||
input."*".xkb_layout = "jp";
|
||||
input."1278:34:HHKB-Hybrid_3_Keyboard".xkb_layout = "jp";
|
||||
input."1:1:AT_Translated_Set_2_keyboard" = {
|
||||
xkb_options = "ctrl:swapcaps";
|
||||
};
|
||||
input."2362:628:PIXA3854:00_093A:0274_Touchpad" = {
|
||||
drag = "enabled";
|
||||
natural_scroll = "enabled";
|
||||
tap = "enabled";
|
||||
};
|
||||
};
|
||||
|
||||
# input-remapping
|
||||
xdg.configFile."autostart/input-remapper-autoload.desktop".source =
|
||||
"${pkgs.input-remapper}/share/applications/input-remapper-autoload.desktop";
|
||||
# Kitty
|
||||
nki.programs.kitty = {
|
||||
enable = true;
|
||||
fontSize = 16;
|
||||
};
|
||||
|
||||
# Multiple screen setup
|
||||
services.kanshi = with config.common.monitors; {
|
||||
enable = true;
|
||||
profiles.undocked.outputs = [{
|
||||
criteria = "eDP-1";
|
||||
}];
|
||||
profiles.work-both.outputs = [
|
||||
{ criteria = "eDP-1"; position = "0,${toString (builtins.floor ((2160 / work.scale - 1200) + 1200 / 3))}"; status = "enable"; }
|
||||
{ criteria = work.name; position = "1920,0"; }
|
||||
];
|
||||
profiles.work-one.outputs = [
|
||||
{ criteria = "eDP-1"; status = "disable"; }
|
||||
{ criteria = config.common.monitors.work.name; }
|
||||
];
|
||||
};
|
||||
|
||||
# This value determines the Home Manager release that your
|
||||
# configuration is compatible with. This helps avoid breakage
|
||||
# when a new Home Manager release introduces backwards
|
||||
# incompatible changes.
|
||||
#
|
||||
# You can update Home Manager without changing this value. See
|
||||
# the Home Manager release notes for a list of state version
|
||||
# changes in each release.
|
||||
home.stateVersion = "21.05";
|
||||
}
|
||||
|
126
nki-framework/configuration.nix
Normal file
126
nki-framework/configuration.nix
Normal file
|
@ -0,0 +1,126 @@
|
|||
# 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, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
# Fonts
|
||||
../modules/personal/fonts
|
||||
# Encrypted DNS
|
||||
../modules/services/edns
|
||||
];
|
||||
|
||||
services.xserver.desktopManager.plasma5.enable = true;
|
||||
|
||||
# Power Management
|
||||
services.upower = {
|
||||
enable = true;
|
||||
criticalPowerAction = "PowerOff";
|
||||
|
||||
usePercentageForPolicy = true;
|
||||
percentageCritical = 3;
|
||||
percentageLow = 10;
|
||||
};
|
||||
services.tlp.enable = false;
|
||||
services.tlp.settings = {
|
||||
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
||||
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||||
|
||||
CPU_MIN_PERF_ON_AC = 0;
|
||||
CPU_MAX_PERF_ON_AC = 100;
|
||||
CPU_MIN_PERF_ON_BAT = 0;
|
||||
CPU_MAX_PERF_ON_BAT = 30;
|
||||
|
||||
PLATFORM_PROFILE_ON_AC = "performance";
|
||||
PLATFORM_PROFILE_ON_BAT = "low-power";
|
||||
|
||||
USB_AUTOSUSPEND = 0;
|
||||
};
|
||||
services.power-profiles-daemon.enable = false;
|
||||
# powerManagement.enable = true;
|
||||
# powerManagement.powertop.enable = true;
|
||||
services.logind.lidSwitch = "suspend";
|
||||
|
||||
# Printing
|
||||
services.printing.drivers = with pkgs; [ epfl-cups-drivers ];
|
||||
|
||||
# Enable touchpad support (enabled default in most desktopManager).
|
||||
services.xserver.libinput.enable = true;
|
||||
# Keyboard
|
||||
services.input-remapper.enable = true;
|
||||
services.input-remapper.serviceWantedBy = [ "multi-user.target" ];
|
||||
hardware.uinput.enable = true;
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
common.linux.username = "nki";
|
||||
|
||||
# Networking
|
||||
common.linux.networking = {
|
||||
hostname = "nki-framework";
|
||||
networks."10-wired".match = "enp*";
|
||||
networks."20-wireless".match = "wlan*";
|
||||
dnsServers = [ "127.0.0.1" ];
|
||||
};
|
||||
nki.services.edns.enable = true;
|
||||
nki.services.edns.ipv6 = true;
|
||||
|
||||
# Backup home
|
||||
services.btrbk.extraPackages = with pkgs; [ sudo ];
|
||||
services.btrbk.instances.home = {
|
||||
onCalendar = "hourly";
|
||||
settings = {
|
||||
snapshot_preserve = "24h 30d 6m 1y";
|
||||
snapshot_preserve_min = "7d";
|
||||
volume."/" = {
|
||||
subvolume.home.snapshot_name = ".backups-home";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Enable fingerprint auth for some stuff
|
||||
security.pam.services.sudo.fprintAuth = true;
|
||||
security.pam.services.swaylock.fprintAuth = true;
|
||||
security.pam.services.login.fprintAuth = true;
|
||||
|
||||
# Secrets
|
||||
# sops.defaultSopsFile = ./secrets.yaml;
|
||||
# sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||
|
||||
## tinc
|
||||
# sops.secrets."tinc/ed25519-private-key" = { };
|
||||
# services.my-tinc = {
|
||||
# enable = true;
|
||||
# hostName = "macbooknix";
|
||||
# ed25519PrivateKey = config.sops.secrets."tinc/ed25519-private-key".path;
|
||||
# bindPort = 6565;
|
||||
# };
|
||||
|
||||
services.dbus.packages = with pkgs; [ gcr ];
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
|
||||
# Copy the NixOS configuration file and link it from the resulting system
|
||||
# (/run/current-system/configuration.nix). This is useful in case you
|
||||
# accidentally delete configuration.nix.
|
||||
# system.copySystemConfiguration = true;
|
||||
|
||||
# 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. It‘s 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 = "22.05"; # Did you read the comment?
|
||||
}
|
||||
|
63
nki-framework/hardware-configuration.nix
Normal file
63
nki-framework/hardware-configuration.nix
Normal file
|
@ -0,0 +1,63 @@
|
|||
# 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 = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/ed6ef17f-4ad2-48ef-99bb-c4c9d12d6646";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=root" ];
|
||||
};
|
||||
services.btrfs.autoScrub = {
|
||||
enable = true;
|
||||
interval = "monthly";
|
||||
};
|
||||
|
||||
common.linux.luksDevices."cryptroot" = "/dev/disk/by-uuid/c676ec99-31d2-420a-af19-a25c4766d87c";
|
||||
|
||||
fileSystems."/home" =
|
||||
{ device = "/dev/disk/by-uuid/ed6ef17f-4ad2-48ef-99bb-c4c9d12d6646";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=home" ];
|
||||
};
|
||||
|
||||
fileSystems."/nix" =
|
||||
{ device = "/dev/disk/by-uuid/ed6ef17f-4ad2-48ef-99bb-c4c9d12d6646";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=nix" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/4843-028F";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/var/swapfile"; size = 32 * 1024; priority = 10; }
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
|
||||
# Fingerprint
|
||||
services.fprintd.enable = true;
|
||||
|
||||
hardware.sensor.iio.enable = true; # Orientaion and ambient light sensors
|
||||
}
|
Loading…
Reference in a new issue