From 7ff460508b376f99c876b01e5785dbf0ba1956af Mon Sep 17 00:00:00 2001 From: Tristan Date: Tue, 9 Jul 2024 17:34:29 +0100 Subject: [PATCH] nixbook: update, add cosmic vm --- flake.lock | 167 ++++++++++++++++++++++--------- flake.nix | 14 +++ hardware/fcs-tristan-nixbook.nix | 2 +- home/programs/work.nix | 1 + lib/cypress.nix | 16 +++ nixos/modules/work.nix | 10 ++ nixos/workstation.nix | 7 +- 7 files changed, 165 insertions(+), 52 deletions(-) create mode 100644 lib/cypress.nix diff --git a/flake.lock b/flake.lock index bcceb8a..f14db77 100644 --- a/flake.lock +++ b/flake.lock @@ -101,20 +101,36 @@ "base16-vim": { "flake": false, "locked": { - "lastModified": 1663659192, - "narHash": "sha256-uJvaYYDMXvoo0fhBZUhN8WBXeJ87SRgof6GEK2efFT0=", - "owner": "chriskempson", + "lastModified": 1716150083, + "narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=", + "owner": "tinted-theming", "repo": "base16-vim", - "rev": "3be3cd82cd31acfcab9a41bad853d9c68d30478d", + "rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d", "type": "github" }, "original": { - "owner": "chriskempson", + "owner": "tinted-theming", "repo": "base16-vim", "type": "github" } }, "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1717312683, + "narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "38fd3954cf65ce6faf3d0d45cd26059e059f07ea", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1673956053, @@ -170,11 +186,11 @@ ] }, "locked": { - "lastModified": 1717097707, - "narHash": "sha256-HC5vJ3oYsjwsCaSbkIPv80e4ebJpNvFKQTBOGlHvjLs=", + "lastModified": 1720327769, + "narHash": "sha256-kAsg3Lg4YKKpGw+f1W2s5hzjP8B0y/juowvjK8utIag=", "owner": "nix-community", "repo": "home-manager", - "rev": "0eb314b4f0ba337e88123e0b1e57ef58346aafd9", + "rev": "6b7ce96f34b324e4e104abc30d06955d216bac71", "type": "github" }, "original": { @@ -192,11 +208,11 @@ ] }, "locked": { - "lastModified": 1714981474, - "narHash": "sha256-b3/U21CJjCjJKmA9WqUbZGZgCvospO3ArOUTgJugkOY=", + "lastModified": 1715930644, + "narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=", "owner": "nix-community", "repo": "home-manager", - "rev": "6ebe7be2e67be7b9b54d61ce5704f6fb466c536f", + "rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d", "type": "github" }, "original": { @@ -205,13 +221,81 @@ "type": "github" } }, + "nixos-cosmic": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1720402578, + "narHash": "sha256-Zw+4iAKfIaSu0x8HZeQzC8r8Gktz8+HdZSdVdZ8buqs=", + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "rev": "bbd44e1198e9a998af04b6973d3f3a2c9950ae46", + "type": "github" + }, + "original": { + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1716948383, - "narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=", + "lastModified": 1720031269, + "narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ad57eef4ef0659193044870c731987a6df5cf56b", + "rev": "9f4128e00b0ae8ec65918efeba59db998750ead6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1720244366, + "narHash": "sha256-WrDV0FPMVd2Sq9hkR5LNHudS3OSMmUrs90JUTN+MXpA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1720282526, + "narHash": "sha256-dudRkHPRivMNOhd04YI+v4sWvn2SnN5ODSPIu5IVbco=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "550ac3e955c30fe96dd8b2223e37e0f5d225c927", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1720031269, + "narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9f4128e00b0ae8ec65918efeba59db998750ead6", "type": "github" }, "original": { @@ -220,29 +304,13 @@ "type": "indirect" } }, - "nixpkgs-stable": { + "nixpkgs_3": { "locked": { - "lastModified": 1716655032, - "narHash": "sha256-kQ25DAiCGigsNR/Quxm3v+JGXAEXZ8I7RAF4U94bGzE=", + "lastModified": 1720181791, + "narHash": "sha256-i4vJL12/AdyuQuviMMd1Hk2tsGt02hDNhA0Zj1m16N8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "59a450646ec8ee0397f5fa54a08573e8240eb91f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-23.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1716651315, - "narHash": "sha256-iMgzIeedMqf30TXZ439zW3Yvng1Xm9QTGO+ZwG1IWSw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "c5187508b11177ef4278edf19616f44f21cc8c69", + "rev": "4284c2b73c8bce4b46a6adf23e16d9e2ec8da4bb", "type": "github" }, "original": { @@ -252,7 +320,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1714912032, "narHash": "sha256-clkcOIkg8G4xuJh+1onLG4HPMpbtzdLv4rHxFzgsH9c=", @@ -271,7 +339,8 @@ "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs", + "nixos-cosmic": "nixos-cosmic", + "nixpkgs": "nixpkgs_2", "sops-nix": "sops-nix", "stable-nixpkgs": "stable-nixpkgs", "stylix": "stylix" @@ -279,15 +348,15 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_2", - "nixpkgs-stable": "nixpkgs-stable" + "nixpkgs": "nixpkgs_3", + "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1716692524, - "narHash": "sha256-sALodaA7Zkp/JD6ehgwc0UCBrSBfB4cX66uFGTsqeFU=", + "lastModified": 1720321395, + "narHash": "sha256-kcI8q9Nh8/CSj0ygfWq1DLckHl8IHhFarL8ie6g7OEk=", "owner": "Mic92", "repo": "sops-nix", - "rev": "962797a8d7f15ed7033031731d0bb77244839960", + "rev": "c184aca4db5d71c3db0c8cbfcaaec337a5d065ea", "type": "github" }, "original": { @@ -298,11 +367,11 @@ }, "stable-nixpkgs": { "locked": { - "lastModified": 1716991068, - "narHash": "sha256-Av0UWCCiIGJxsZ6TFc+OiKCJNqwoxMNVYDBChmhjNpo=", + "lastModified": 1719957072, + "narHash": "sha256-gvFhEf5nszouwLAkT9nWsDzocUTqLWHuL++dvNjMp9I=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "25cf937a30bf0801447f6bf544fc7486c6309234", + "rev": "7144d6241f02d171d25fba3edeaf15e0f2592105", "type": "github" }, "original": { @@ -320,17 +389,17 @@ "base16-kitty": "base16-kitty", "base16-tmux": "base16-tmux", "base16-vim": "base16-vim", - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "gnome-shell": "gnome-shell", "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1716895458, - "narHash": "sha256-W9Y/+K4L7JcF5xcXO4MVGQk/0DgzHrp/IjlHyLeYExY=", + "lastModified": 1719525570, + "narHash": "sha256-xSO/H67GAHEW0siD2PHoO/e97MbROL3r3s5SpF6A6Dc=", "owner": "danth", "repo": "stylix", - "rev": "5234b3d467aa803ad8d3fe898ef5673246045984", + "rev": "1ff9d37d27377bfe8994c24a8d6c6c1734ffa116", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d0a4256..492787f 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,7 @@ }; stylix.url = "github:danth/stylix"; sops-nix.url = "github:Mic92/sops-nix"; + nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic"; }; outputs = inputs: let @@ -87,6 +88,19 @@ ./home/workstation.nix ]; + vm-cosmic = + mkConf + [ + ./hardware/vm.nix + ./nixos/workstation.nix + { + services.desktopManager.cosmic.enable = true; + services.displayManager.cosmic-greeter.enable = true; + } + ] [ + ./home/workstation.nix + ]; + vm-hyprland = builtins.trace '' use super+enter to start a terminal. diff --git a/hardware/fcs-tristan-nixbook.nix b/hardware/fcs-tristan-nixbook.nix index a6f26f9..e22cc1a 100644 --- a/hardware/fcs-tristan-nixbook.nix +++ b/hardware/fcs-tristan-nixbook.nix @@ -66,7 +66,7 @@ in { powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - hardware.opengl = { + hardware.graphics = { enable = true; extraPackages = with pkgs; [ intel-media-driver # LIBVA_DRIVER_NAME=iHD diff --git a/home/programs/work.nix b/home/programs/work.nix index 0f742ab..736dbe5 100644 --- a/home/programs/work.nix +++ b/home/programs/work.nix @@ -18,6 +18,7 @@ in { home.packages = with pkgs; [ thunderbird remmina + devcontainer (import ../../lib/mkapp.nix "slack" { inherit pkgs; desktopName = "Slack"; diff --git a/lib/cypress.nix b/lib/cypress.nix new file mode 100644 index 0000000..775b7f6 --- /dev/null +++ b/lib/cypress.nix @@ -0,0 +1,16 @@ +final: prev: { + cypress = prev.cypress.overrideAttrs (oldAttrs: rec { + pname = "cypress"; + version = "13.8.0"; + + src = prev.fetchzip { + url = "https://cdn.cypress.io/desktop/${version}/linux-x64/cypress.zip"; + # sha256 = "sha256-cLjvISkA8UM2OU3ANYbrXD/pHE0iu69z+Ehh5N0jGxY="; + sha256 = "sha256-9SSUbEZtyhl14FOcQwj2x/Utf1YuGtzt8hfLNaN3hvs="; + ## Note: sha256 is computed via (note the version): + ## + ## nix-prefetch-url --unpack https://cdn.cypress.io/desktop/12.1.0/linux-x64/cypress.zip + }; + }); +} + diff --git a/nixos/modules/work.nix b/nixos/modules/work.nix index 4c533b0..15fb5ec 100644 --- a/nixos/modules/work.nix +++ b/nixos/modules/work.nix @@ -19,6 +19,16 @@ in { }; }; + # breaks some work projects ):< + networking.stevenblack.enable = false; + + nixpkgs.overlays = [ (import ../../lib/cypress.nix) ]; + + environment.variables = { + CYPRESS_INSTALL_BINARY=0; + CYPRESS_RUN_BINARY="${pkgs.cypress}/bin/Cypress"; + }; + services.onedrive.enable = true; users.users.${user}.extraGroups = ["docker"]; diff --git a/nixos/workstation.nix b/nixos/workstation.nix index fe841b8..a62914e 100644 --- a/nixos/workstation.nix +++ b/nixos/workstation.nix @@ -1,13 +1,15 @@ { inputs, pkgs, + lib, ... }: { imports = [ inputs.stylix.nixosModules.stylix + inputs.nixos-cosmic.nixosModules.default ]; nixpkgs.config.permittedInsecurePackages = [ - "electron-25.9.0" + "electron-27.3.11" ]; programs.hyprland = { @@ -63,11 +65,12 @@ virtualisation.waydroid.enable = true; networking.stevenblack = { - enable = true; + enable = lib.mkDefault true; block = ["porn" "gambling"]; }; stylix = { + enable = true; image = ../images/nix-soft.png; base16Scheme = "${pkgs.base16-schemes}/share/themes/onedark.yaml"; opacity = {