move newer settings from yoga to common

This commit is contained in:
Cyryl Płotnicki 2023-01-08 12:39:21 +00:00
parent 93b10f9a82
commit cc62207eb4
5 changed files with 231 additions and 275 deletions

View file

@ -1,21 +1,9 @@
{ {
description = "NixOS configuration with flakes"; description = "NixOS configuration with flakes";
outputs = { outputs = { self, flake-utils, flake-compat, home-manager
self, , nixpkgs-nixos-unstable, nixpkgs-master, nixpkgs-stable, darwin
flake-utils, , nixos-hardware, nur, sops, nil, helix, alejandra, }@inputs:
flake-compat, let
home-manager,
nixpkgs-nixos-unstable,
nixpkgs-master,
nixpkgs-stable,
darwin,
nixos-hardware,
nur,
sops,
nil,
helix,
alejandra,
} @ inputs: let
mkServer = pkgs: system: hostname: mkServer = pkgs: system: hostname:
pkgs.lib.nixosSystem { pkgs.lib.nixosSystem {
inherit system; inherit system;
@ -24,20 +12,20 @@
(import ./nixos/server-common.nix) (import ./nixos/server-common.nix)
sops.nixosModules.sops sops.nixosModules.sops
]; ];
specialArgs = {inherit inputs;}; specialArgs = { inherit inputs; };
}; };
mkRaspi = pkgs: hostname: mkRaspi = pkgs: hostname:
pkgs.lib.nixosSystem { pkgs.lib.nixosSystem {
system = "aarch64-linux"; system = "aarch64-linux";
modules = [(./. + "/nixos/boxes/${hostname}")]; modules = [ (./. + "/nixos/boxes/${hostname}") ];
specialArgs = {inherit inputs;}; specialArgs = { inherit inputs; };
}; };
mkKiosk = pkgs: system: hostname: mkKiosk = pkgs: system: hostname:
pkgs.lib.nixosSystem { pkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
(./. + "/nixos/boxes/${hostname}") (./. + "/nixos/boxes/${hostname}")
(import ./nixos/common.nix)
sops.nixosModules.sops sops.nixosModules.sops
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
@ -45,13 +33,24 @@
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.cyryl = { home-manager.users.cyryl = {
imports = [./nixos/home-manager ./nixos/home-manager/linux.nix]; imports =
[ ./nixos/home-manager ./nixos/home-manager/linux.nix ];
_module.args.inputs = inputs; _module.args.inputs = inputs;
_module.args.system = system; _module.args.system = system;
}; };
} }
]; ];
specialArgs = {inherit inputs system;}; specialArgs = {
inherit inputs system;
nixpkgs-nixos-stable-and-unfree = import nixpkgs-stable {
inherit system;
config = { allowUnfree = true; };
};
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system;
config = { allowUnfree = true; };
};
};
}; };
mkWorkstation = pkgs: system: hostname: mkWorkstation = pkgs: system: hostname:
pkgs.lib.nixosSystem { pkgs.lib.nixosSystem {
@ -67,7 +66,8 @@
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.cyryl = { home-manager.users.cyryl = {
imports = [./nixos/home-manager ./nixos/home-manager/linux.nix]; imports =
[ ./nixos/home-manager ./nixos/home-manager/linux.nix ];
_module.args.inputs = inputs; _module.args.inputs = inputs;
_module.args.system = system; _module.args.system = system;
}; };
@ -77,18 +77,17 @@
inherit inputs system; inherit inputs system;
nixpkgs-nixos-stable-and-unfree = import nixpkgs-stable { nixpkgs-nixos-stable-and-unfree = import nixpkgs-stable {
inherit system; inherit system;
config = {allowUnfree = true;}; config = { allowUnfree = true; };
}; };
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable { nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system; inherit system;
config = {allowUnfree = true;}; config = { allowUnfree = true; };
}; };
}; };
}; };
mkShell = packageSet: system: let mkShell = packageSet: system:
pkgs = packageSet.legacyPackages.${system}; let pkgs = packageSet.legacyPackages.${system};
in in pkgs.mkShell {
pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
cacert cacert
git git
@ -115,7 +114,7 @@
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.cyryl = { home-manager.users.cyryl = {
imports = [./nixos/home-manager]; imports = [ ./nixos/home-manager ];
_module.args.inputs = inputs; _module.args.inputs = inputs;
_module.args.system = system; _module.args.system = system;
}; };
@ -135,12 +134,12 @@
bootstrap = nixpkgs-stable.lib.nixosSystem rec { bootstrap = nixpkgs-stable.lib.nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [(./. + "/nixos/boxes/bootstrap") sops.nixosModules.sops]; modules = [ (./. + "/nixos/boxes/bootstrap") sops.nixosModules.sops ];
specialArgs = { specialArgs = {
inherit inputs system; inherit inputs system;
nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable { nixpkgs-nixos-unstable-and-unfree = import nixpkgs-nixos-unstable {
inherit system; inherit system;
config = {allowUnfree = true;}; config = { allowUnfree = true; };
}; };
}; };
}; };
@ -153,7 +152,8 @@
(import (import
"${inputs.nixpkgs-nixos-unstable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix") "${inputs.nixpkgs-nixos-unstable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix")
{ {
environment.systemPackages = with nixpkgs-nixos-unstable.legacyPackages."aarch64-linux"; [ environment.systemPackages =
with nixpkgs-nixos-unstable.legacyPackages."aarch64-linux"; [
neovim neovim
htop htop
btop btop
@ -185,7 +185,7 @@
console.earlySetup = true; console.earlySetup = true;
} }
]; ];
specialArgs = {inherit inputs;}; specialArgs = { inherit inputs; };
}; };
}; };
}; };

View file

@ -1,26 +1,16 @@
{ { config, pkgs, inputs, lib, system, nixpkgs-nixos-unstable-and-unfree, ... }: {
config,
pkgs,
inputs,
lib,
system,
nixpkgs-nixos-unstable-and-unfree,
...
}: {
networking.hostName = "yoga"; networking.hostName = "yoga";
imports = [./hardware-configuration.nix ../../boot.nix ../../git]; imports = [ ./hardware-configuration.nix ../../boot.nix ../../git ../../gui ];
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
hardware.trackpoint.enable = true; hardware.trackpoint.enable = true;
services.hardware.bolt.enable = true; services.hardware.bolt.enable = true;
services.fprintd = {enable = true;}; services.fprintd = { enable = true; };
home-manager.users.cyryl = {lib, ...}: { home-manager.users.cyryl = { lib, ... }: { home.packages = with pkgs; [ ]; };
home.packages = with pkgs; [firefox vim gnome3.gedit git];
};
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
@ -45,13 +35,6 @@
services.xserver.displayManager.gdm.enable = true; services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true; services.xserver.desktopManager.gnome.enable = true;
services.xserver = {
layout = "pl";
xkbVariant = "";
};
console.keyMap = "pl2";
services.printing.enable = true; services.printing.enable = true;
sound.enable = true; sound.enable = true;
@ -77,9 +60,7 @@
isNormalUser = true; isNormalUser = true;
description = "cyryl"; description = "cyryl";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [ packages = with pkgs; [ ];
firefox
];
}; };
services.fwupd.enable = true; services.fwupd.enable = true;
@ -91,15 +72,5 @@
systemd.services."getty@tty1".enable = false; systemd.services."getty@tty1".enable = false;
systemd.services."autovt@tty1".enable = false; systemd.services."autovt@tty1".enable = false;
nix = { system = { stateVersion = "22.11"; };
settings.auto-optimise-store = true;
gc.automatic = true;
optimise.automatic = true;
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
system = {stateVersion = "22.11";};
} }

View file

@ -1,19 +1,12 @@
{ { config, pkgs, nixpkgs-nixos-unstable-and-unfree, lib, ... }: {
config, boot.kernelModules = [ "fuse" ];
pkgs,
nixpkgs-nixos-unstable-and-unfree,
lib,
...
}: {
boot.kernelModules = ["fuse"];
services.smartd.enable = true; services.smartd.enable = true;
sound.enable = true; sound.enable = true;
networking.networkmanager = { networking.networkmanager = {
enable = true; enable = true;
dispatcherScripts = [ dispatcherScripts = [{
{
source = pkgs.writeText "upHook" '' source = pkgs.writeText "upHook" ''
enable_disable_wifi () enable_disable_wifi ()
{ {
@ -34,32 +27,35 @@
fi fi
''; '';
type = "basic"; type = "basic";
} }];
];
}; };
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;
hardware.cpu.intel.updateMicrocode = true; hardware.cpu.intel.updateMicrocode = true;
hardware.pulseaudio = {
enable = true;
package = pkgs.pulseaudioFull;
support32Bit = true;
extraModules = [];
daemon.config = {
nice-level = -15;
realtime-scheduling = "yes";
};
};
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = true;
package = pkgs.bluezFull; package = pkgs.bluezFull;
settings = {General = {Enable = "Source,Sink,Media,Socket";};}; settings = { General = { Enable = "Source,Sink,Media,Socket"; }; };
}; };
services.blueman.enable = true; services.blueman.enable = true;
environment.systemPackages = with pkgs; [ghostscript poppler]; hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
environment.systemPackages = with pkgs; [ ghostscript poppler ];
services.printing = { services.printing = {
enable = true; enable = true;
drivers = with pkgs; [ drivers = with pkgs; [
@ -77,7 +73,8 @@
description = "Epson XP-540 via bolty"; description = "Epson XP-540 via bolty";
name = "epson_xp540_via_bolty"; name = "epson_xp540_via_bolty";
deviceUri = "ipp://bolty:631/printers/epson_xp540"; deviceUri = "ipp://bolty:631/printers/epson_xp540";
model = "epson-inkjet-printer-escpr/Epson-XP-540_Series-epson-escpr-en.ppd"; model =
"epson-inkjet-printer-escpr/Epson-XP-540_Series-epson-escpr-en.ppd";
ppdOptions = { ppdOptions = {
PageSize = "A4"; PageSize = "A4";
Duplex = "DuplexNoTumble"; Duplex = "DuplexNoTumble";
@ -86,7 +83,8 @@
{ {
description = "Samsung SCX-4623 Series"; description = "Samsung SCX-4623 Series";
name = "samsung-SCX-4623"; name = "samsung-SCX-4623";
deviceUri = "usb://Samsung/SCX-4623%20Series?serial=Z2TYBFFZC01007W&interface=1"; deviceUri =
"usb://Samsung/SCX-4623%20Series?serial=Z2TYBFFZC01007W&interface=1";
model = "samsung/SCX-4623FW.ppd"; model = "samsung/SCX-4623FW.ppd";
ppdOptions = { ppdOptions = {
PageSize = "A4"; PageSize = "A4";
@ -95,7 +93,7 @@
} }
]; ];
services.udev.packages = [pkgs.utsushi]; services.udev.packages = [ pkgs.utsushi ];
hardware.sane = { hardware.sane = {
enable = true; enable = true;
snapshot = true; snapshot = true;

View file

@ -1,12 +1,9 @@
{ { config, pkgs, ... }: {
config,
pkgs, console.keyMap = "pl2";
... imports = [ ./tailscale ];
}: {
console.keyMap = "pl";
imports = [./tailscale];
services = { services = {
udev.packages = [pkgs.android-udev-rules]; udev.packages = [ pkgs.android-udev-rules ];
ratbagd.enable = true; ratbagd.enable = true;
fwupd = { fwupd = {
@ -14,11 +11,7 @@
package = pkgs.fwupd; package = pkgs.fwupd;
}; };
tlp = { power-profiles-daemon.enable = true;
enable = true;
settings = {"DISK_IOSCHED" = "mq-deadline";};
};
upower.enable = true; upower.enable = true;
fstrim.enable = true; fstrim.enable = true;
clipmenu.enable = true; clipmenu.enable = true;
@ -33,6 +26,7 @@
enable = true; enable = true;
layout = "pl"; layout = "pl";
xkbOptions = "caps:ctrl_modifier"; xkbOptions = "caps:ctrl_modifier";
xkbVariant = "";
libinput = { libinput = {
enable = true; enable = true;
touchpad = { touchpad = {

View file

@ -1,6 +1,6 @@
{ config, pkgs, lib, inputs, nixpkgs-nixos-unstable-and-unfree, ... }: { config, pkgs, lib, inputs, nixpkgs-nixos-unstable-and-unfree, ... }:
let let
stateVersion = "22.05"; stateVersion = "22.11";
username = "cyryl"; username = "cyryl";
in { in {
imports = [ imports = [
@ -73,14 +73,7 @@ in {
defaultFonts.monospace = [ "Berkeley Mono" ]; defaultFonts.monospace = [ "Berkeley Mono" ];
}; };
fonts.fonts = with pkgs; fonts.fonts = with pkgs; [ ];
[
(fetchzip {
url = "file://" + ./fonts.zip;
sha256 = "sha256-EfWED+hF/A0og3+oTYUuDUSq3OhdY2+fHmGKkBMQOnc=";
stripRoot = false;
})
];
nix = { nix = {
settings.auto-optimise-store = true; settings.auto-optimise-store = true;