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;
@ -37,28 +25,6 @@
inherit system; inherit system;
modules = [ modules = [
(./. + "/nixos/boxes/${hostname}") (./. + "/nixos/boxes/${hostname}")
sops.nixosModules.sops
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.cyryl = {
imports = [./nixos/home-manager ./nixos/home-manager/linux.nix];
_module.args.inputs = inputs;
_module.args.system = system;
};
}
];
specialArgs = {inherit inputs system;};
};
mkWorkstation = pkgs: system: hostname:
pkgs.lib.nixosSystem {
inherit system;
modules = [
(./. + "/nixos/boxes/${hostname}")
(import ./nixos/email-accounts.nix)
(import ./nixos/common.nix) (import ./nixos/common.nix)
sops.nixosModules.sops sops.nixosModules.sops
@ -67,7 +33,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;
}; };
@ -85,10 +52,42 @@
}; };
}; };
}; };
mkShell = packageSet: system: let mkWorkstation = pkgs: system: hostname:
pkgs = packageSet.legacyPackages.${system}; pkgs.lib.nixosSystem {
in inherit system;
pkgs.mkShell { modules = [
(./. + "/nixos/boxes/${hostname}")
(import ./nixos/email-accounts.nix)
(import ./nixos/common.nix)
sops.nixosModules.sops
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.cyryl = {
imports =
[ ./nixos/home-manager ./nixos/home-manager/linux.nix ];
_module.args.inputs = inputs;
_module.args.system = 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; };
};
};
};
mkShell = packageSet: system:
let pkgs = packageSet.legacyPackages.${system};
in pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
cacert cacert
git git
@ -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

View file

@ -1,15 +1,7 @@
{ { 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;
@ -18,9 +10,7 @@
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 = {
settings.auto-optimise-store = true;
gc.automatic = true;
optimise.automatic = true;
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
system = { stateVersion = "22.11"; }; system = { stateVersion = "22.11"; };
} }

View file

@ -1,10 +1,4 @@
{ { config, pkgs, nixpkgs-nixos-unstable-and-unfree, lib, ... }: {
config,
pkgs,
nixpkgs-nixos-unstable-and-unfree,
lib,
...
}: {
boot.kernelModules = [ "fuse" ]; boot.kernelModules = [ "fuse" ];
services.smartd.enable = true; services.smartd.enable = true;
@ -12,8 +6,7 @@
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,22 +27,11 @@
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;
@ -59,6 +41,20 @@
services.blueman.enable = true; services.blueman.enable = true;
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 ]; environment.systemPackages = with pkgs; [ ghostscript poppler ];
services.printing = { services.printing = {
enable = true; enable = true;
@ -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";

View file

@ -1,9 +1,6 @@
{ { config, pkgs, ... }: {
config,
pkgs, console.keyMap = "pl2";
...
}: {
console.keyMap = "pl";
imports = [ ./tailscale ]; imports = [ ./tailscale ];
services = { services = {
udev.packages = [ pkgs.android-udev-rules ]; udev.packages = [ pkgs.android-udev-rules ];
@ -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;