Skip to content

Commit

Permalink
Add new desktop system
Browse files Browse the repository at this point in the history
  • Loading branch information
adisbladis committed Nov 5, 2019
1 parent c0230fe commit 8707a0b
Show file tree
Hide file tree
Showing 17 changed files with 360 additions and 23 deletions.
2 changes: 0 additions & 2 deletions home-adisbladis-nixpkgs/desktop.nix
Expand Up @@ -44,8 +44,6 @@ in {
yubioath-desktop
];

services.blueman-applet.enable = true;

services.pasystray.enable = true;

services.flameshot.enable = true;
Expand Down
2 changes: 1 addition & 1 deletion home-adisbladis-nixpkgs/emacs/default.nix
Expand Up @@ -3,7 +3,7 @@
}:

emacsWithPackagesFromUsePackage {
# package = pkgs.emacsGit;
package = pkgs.emacsGit;

config = builtins.readFile ./emacs.el;

Expand Down
2 changes: 1 addition & 1 deletion home-adisbladis-nixpkgs/emacs/emacs.el
Expand Up @@ -379,7 +379,7 @@
;; (start-process-shell-command cmd nil cmd))))

(setq browse-url-firefox-arguments '("-new-window"))
(setq exwm-randr-workspace-output-plist '(1 "DP1"))
(setq exwm-randr-workspace-output-plist '(1 "HDMI2"))
(require 'exwm-config)
(exwm-config-default)
(exwm-randr-enable)
Expand Down
2 changes: 1 addition & 1 deletion home-adisbladis-nixpkgs/home-manager
14 changes: 7 additions & 7 deletions hosts/gari/configuration.nix
Expand Up @@ -23,17 +23,13 @@ in {
pkgs.libva-utils
];

programs.adb.enable = true;

boot.kernelPackages = lib.mkForce pkgs.linuxPackages_5_1;

boot.initrd.availableKernelModules = [
"aes_x86_64"
"aesni_intel"
"cryptd"
];

# virtualisation.docker.enable = true;
virtualisation.docker.enable = true;

# nixpkgs.config.allowUnfree = true;
# users.extraGroups.vboxusers.members = [ "adisbladis" ];
Expand Down Expand Up @@ -73,19 +69,22 @@ in {
# Bumblebee has issues with tearing and crashes
# Power use is good enough without it anyway
hardware.opengl.enable = true;

hardware.opengl.extraPackages = [
(pkgs.vaapiIntel.override { enableHybridCodec = true; })
pkgs.vaapiVdpau
pkgs.libva-utils
pkgs.libvdpau-va-gl
pkgs.intel-media-driver
];
services.xserver.videoDrivers = [ "nouveau" "intel" ];
services.xserver.videoDrivers = [
# "nouveau"
"intel"
];
services.xserver.deviceSection = ''
Option "Tearfree" "true"
'';
boot.kernelParams = [ "i915.enable_psr=1" ];

environment.variables = {
MESA_LOADER_DRIVER_OVERRIDE = "iris";
};
Expand All @@ -108,6 +107,7 @@ in {

hardware.cpu.intel.updateMicrocode = true;

# Gemini PDA
services.udev.extraRules = ''
ATTRS{idVendor}=="0e8d", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="6000", ENV{ID_MM_DEVICE_IGNORE}="1"
Expand Down
19 changes: 19 additions & 0 deletions nixops-deployment/deployment.nix
Expand Up @@ -12,6 +12,25 @@
deployment.targetHost = "159.69.86.193";
};

tablet =
{ resources, ... }:
{
imports = [
./tablet/configuration.nix
];

deployment.targetHost = "192.168.0.61";
};

kombu =
{ resources, ... }:
{
imports = [
./kombu/configuration.nix
];
deployment.targetHost = "192.168.0.70";
};

# laptop =
# { resources, ... }:
# {
Expand Down
52 changes: 52 additions & 0 deletions nixops-deployment/kombu/configuration.nix
@@ -0,0 +1,52 @@
{ config, pkgs, ... }:

let
secrets = import ../../secrets.nix;

in {
imports = [
./hardware-configuration.nix
../../profiles/common.nix
../../profiles/graphical-desktop.nix
];

# For tmpfs /
environment.etc."nixos".source = pkgs.runCommand "persistent-link" {} ''
ln -s /nix/persistent/etc/nixos $out
'';


users.users.root.initialHashedPassword = secrets.passwordHash;
users.users.adisbladis.initialHashedPassword = secrets.passwordHash;
users.mutableUsers = false;

# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;

networking.hostId = "b6d4529e";
networking.hostName = "kombu";
networking.networkmanager.enable = true;

services.xserver.videoDrivers = [ "amdgpu" ];

hardware.cpu.amd.updateMicrocode = true;

hardware.enableRedistributableFirmware = true;

hardware.opengl.enable = true;
hardware.opengl.driSupport = true;

# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.openssh.passwordAuthentication = false;

networking.useDHCP = false;
networking.interfaces.eno1.useDHCP = true;
networking.interfaces.eno2.useDHCP = true;
networking.interfaces.wlp37s0.useDHCP = true;

system.stateVersion = "20.03"; # Did you read the comment?


}
34 changes: 34 additions & 0 deletions nixops-deployment/kombu/hardware-configuration.nix
@@ -0,0 +1,34 @@
# 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, ... }:

{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];

boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];

fileSystems."/" =
{ device = "none";
fsType = "tmpfs";
};

fileSystems."/nix" =
{ device = "zroot/nix";
fsType = "zfs";
};

fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/2E10-DFF0";
fsType = "vfat";
};

swapDevices = [ ];

nix.maxJobs = lib.mkDefault 64;
}
123 changes: 123 additions & 0 deletions nixops-deployment/tablet/configuration.nix
@@ -0,0 +1,123 @@
# 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, ... }:

{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];

# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;

networking.hostName = "tmpname"; # Define your hostname.

# Select internationalisation properties.
# i18n = {
# consoleFont = "Lat2-Terminus16";
# consoleKeyMap = "us";
# defaultLocale = "en_US.UTF-8";
# };

# Set your time zone.
time.timeZone = "Asia/Hong_Kong";

# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
wget
curl
mpv
unzip
kdeconnect
# firefox
# chromium
falkon
# krita

htop
];

# User stuffs
services.avahi.enable = true;

# Sane font defaults
fonts.enableFontDir = true;
fonts.enableGhostscriptFonts = true;
fonts.fontconfig.ultimate.enable = true;
fonts.fontconfig.ultimate.preset = "osx";

fonts.fonts = with pkgs; [
liberation_ttf
inconsolata
dejavu_fonts
emacs-all-the-icons-fonts
powerline-fonts
source-code-pro
];

environment.variables = {
# Enable on screen keyboard globally
QT_IM_MODULE = "qtvirtualkeyboard";
};

services.upower.enable = true;

programs.fish.enable = true;

hardware.bluetooth.enable = true;
# hardware.pulseaudio.package = pkgs.pulseaudioFull;

services.xserver.enable = true;
services.xserver.layout = "se";
services.xserver.xkbOptions = "eurosign:e";
services.xserver.xkbVariant = "dvorak";

services.xserver.displayManager.sddm.enable = true;
# services.xserver.displayManager.sddm.autoLogin.enable = true;
# services.xserver.displayManager.sddm.autoLogin.user = "adisbladis";

services.xserver.desktopManager.plasma5.enableQt4Support = false;
services.xserver.desktopManager.plasma5.enable = true;
services.xserver.desktopManager.xterm.enable = false;

services.unbound.enable = true;

# Define a user account. Don't forget to set a password with ‘passwd’.
users.extraUsers.adisbladis = {
isNormalUser = true;
uid = 1000;
extraGroups = [ "wheel" "networkmanager" "video" "audio" ];
shell = pkgs.fish;

openssh.authorizedKeys.keys = [
"ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAACAQCTrw8gZoBYkh4Ud8/QCXAaJk020XMbRlcu61QPTnpjvLLxAwSr3d+K7ccDal9FaSQg0GBx58aVRcdVoFBFmHbX6iqR6OT2hoenbxRfVa69DaY6w/eIY5seQ0Xzio8PsX2Cc4IPdM3XqlpTLhQ2+/kNnDC9/NYs2UX6r318uHrHPW5hs6rFPxvekcel56Vy1LKrMb5EgLwOFuhqegKpuZl6Dw39HHAIi0+cVCqc+eP8SmgdcYCm7CjLXU4mV8BwIMx/8TSDravJhnRLYX+S+BFUA3sXTeg1xzUKhFTE3lF4MJTNB613bcygX4HLXcG0YJ/6CDLBVey0xCfyKSbc18nlhRzuePzU8yYL8TRVoMJrEEurq8ZrkxX+lFs83CnFq4epH3vdz+Y6Q8foTVEF0XECgJ08MElXZRFRA5iWvO4S2PQLqn8LKRVxbF6NV34IrchCQavirZCv01FKRYfbpiNSzGLxKn2qvHDiYeqLV8gqj6wgO+DF8w6DsJcEUO3qiUDpbfXMCU8S5HgwVB7oOh+0g0Gq81HmjX0/a2WhuhbwC1Glt+gyLCLd/2RTRIetMymT8kZ61izVVNh0PeAoy4d2DpcKdmaK8CNjZ1/8c9a4Pxzg1HIHlPEyKf9NZ+TlGlUjmTEVOefxAWBVpQuwqEsOF1BkG9tDZsPQdcMhZbtvYQ==
cardno:000605255225"
];
};

services.openssh.enable = true;
services.openssh.permitRootLogin = "yes";

networking.firewall.enable = false;

sound.enable = true;
hardware.pulseaudio.enable = true;

services.xserver.libinput.enable = true;
networking.networkmanager.enable = true;

boot.kernelPackages = pkgs.linuxPackages_latest;
hardware.enableRedistributableFirmware = true;
hardware.firmware = with pkgs; [
firmwareLinuxNonfree
];

system.stateVersion = "18.09"; # Did you read the comment?

}
31 changes: 31 additions & 0 deletions nixops-deployment/tablet/hardware-configuration.nix
@@ -0,0 +1,31 @@
# 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, ... }:

{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];

boot.initrd.availableKernelModules = [ "xhci_pci" "dwc3_pci" "usb_storage" "usbhid" "sd_mod" "sdhci_acpi" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];

fileSystems."/" =
{ device = "/dev/disk/by-uuid/1769a4cf-b1ad-4180-b5c4-0eb9d637a5e1";
fsType = "ext4";
};

fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/DBCE-D7BC";
fsType = "vfat";
};

swapDevices =
[ { device = "/dev/disk/by-uuid/90462b55-bc98-4c7f-b76d-5a187f1f3e36"; }
];

nix.maxJobs = lib.mkDefault 4;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}
41 changes: 41 additions & 0 deletions nixops-deployment/tablet/rtlbt/#default.nix#
@@ -0,0 +1,41 @@
{ stdenv, lib, fetchFromGitHub, kernel }:

with lib;

let modDestDir = "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/net/wireless/realtek/rtlwifi";

in stdenv.mkDerivation rec {
name = "rtl8723bs_bt-${version}";
version = "2016-07-18";

src = fetchFromGitHub {
owner = "lwfinger";
repo = "rtlwifi_new";
rev = "09eb91f52a639ec5e4c5c4c98dc2afede046cf20";
sha256 = "0b7mvvsdsih48nb3dgknfd9xj5h38q8wyspxi7h0hynb8szjjda4";
};

hardeningDisable = [ "pic" "format" ];

nativeBuildInputs = kernel.moduleBuildDependencies;

makeFlags = "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";

enableParallelBuilding = true;

installPhase = ''
mkdir -p ${modDestDir}
find . -name '*.ko' -exec cp --parents {} ${modDestDir} \;
find ${modDestDir} -name '*.ko' -exec xz -f {} \;
'';

meta = {
description = "";
inherit (src.meta) homepage;
license = stdenv.lib.licenses.gpl2;
platforms = with platforms; linux;
maintainers = with maintainers; [ tvorog ];
priority = -1;
};
}

0 comments on commit 8707a0b

Please sign in to comment.