From 01dca83d6f1e3d612d97c99bd529d24cee1a8341 Mon Sep 17 00:00:00 2001 From: Mirza <21687187+arunoruto@users.noreply.github.com> Date: Sun, 22 Sep 2024 23:20:10 +0200 Subject: [PATCH] Add cosmic DE --- flake.lock | 181 +++++++++++++++++++++++++++--- flake.nix | 23 +--- hosts/yhwach/configuration.nix | 6 +- modules/nixos/desktop/cosmic.nix | 21 ++++ modules/nixos/desktop/default.nix | 2 + 5 files changed, 194 insertions(+), 39 deletions(-) create mode 100644 modules/nixos/desktop/cosmic.nix diff --git a/flake.lock b/flake.lock index b62e93d..55e8c0e 100644 --- a/flake.lock +++ b/flake.lock @@ -171,6 +171,22 @@ } }, "flake-compat_2": { + "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_3": { "flake": false, "locked": { "lastModified": 1673956053, @@ -207,6 +223,28 @@ "type": "github" } }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "nixos-cosmic", + "nix-update", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems_2" @@ -305,11 +343,11 @@ ] }, "locked": { - "lastModified": 1726818100, - "narHash": "sha256-z2V74f5vXqkN5Q+goFlhbFXY/dNaBAyeLpr2bxu4Eic=", + "lastModified": 1726989464, + "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", "owner": "nix-community", "repo": "home-manager", - "rev": "1bbc1a5a1f4de7401c92db85b2119ed21bb4139d", + "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176", "type": "github" }, "original": { @@ -408,13 +446,60 @@ "type": "github" } }, + "nix-update": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": [ + "nixos-cosmic", + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1726651036, + "narHash": "sha256-6kR4UEBZvbQNoR3l8/It5ZTCC+mB14jzj7MNnFoQJwE=", + "owner": "Mic92", + "repo": "nix-update", + "rev": "7dd0e4467c571ebb7e53d9e3d40c49f75473efdf", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-update", + "type": "github" + } + }, + "nixos-cosmic": { + "inputs": { + "flake-compat": "flake-compat_2", + "nix-update": "nix-update", + "nixpkgs": [ + "nixpkgs-unstable" + ], + "nixpkgs-stable": "nixpkgs-stable_2", + "rust-overlay": "rust-overlay_2" + }, + "locked": { + "lastModified": 1727038926, + "narHash": "sha256-5etlzWSRvXzqgxdK3o1dwzulbVwXfQUnrlIoJiz7a90=", + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "rev": "d763e00d430621daf2b796a309d03f4f70d35331", + "type": "github" + }, + "original": { + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "type": "github" + } + }, "nixos-hardware": { "locked": { - "lastModified": 1726724509, - "narHash": "sha256-sVeAM1tgVi52S1e29fFBTPUAFSzgQwgLon3CrztXGm8=", + "lastModified": 1726905744, + "narHash": "sha256-xyNtG5C+xvfsnOVEamFe9zCCnuNwk93K/TlFC/4DmCI=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "10d5e0ecc32984c1bf1a9a46586be3451c42fd94", + "rev": "b493dfd4a8cf9552932179e56ff3b5819a9b8381", "type": "github" }, "original": { @@ -456,6 +541,22 @@ } }, "nixpkgs-stable_2": { + "locked": { + "lastModified": 1726838390, + "narHash": "sha256-NmcVhGElxDbmEWzgXsyAjlRhUus/nEqPC5So7BOJLUM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "944b2aea7f0a2d7c79f72468106bc5510cbf5101", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_3": { "locked": { "lastModified": 1725762081, "narHash": "sha256-vNv+aJUW5/YurRy1ocfvs4q/48yVESwlC/yHzjkZSP8=", @@ -489,11 +590,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1726688310, - "narHash": "sha256-Xc9lEtentPCEtxc/F1e6jIZsd4MPDYv4Kugl9WtXlz0=", + "lastModified": 1726838390, + "narHash": "sha256-NmcVhGElxDbmEWzgXsyAjlRhUus/nEqPC5So7BOJLUM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "dbebdd67a6006bb145d98c8debf9140ac7e651d0", + "rev": "944b2aea7f0a2d7c79f72468106bc5510cbf5101", "type": "github" }, "original": { @@ -505,11 +606,11 @@ }, "nur": { "locked": { - "lastModified": 1726867452, - "narHash": "sha256-KOYfmRwrVIZalP0rUCD2dGZyujOagimlERk2Uj4wq/A=", + "lastModified": 1727037928, + "narHash": "sha256-rUqFEfcY/XT80EXswhqDlgk+lzD2E5gmKzIaIrG+llU=", "owner": "nix-community", "repo": "NUR", - "rev": "bd9f04ac4cfc12e9582668a01499c0ea80dd6fd5", + "rev": "159956153a4b6721bb188d6d695cf5be7983763d", "type": "github" }, "original": { @@ -528,11 +629,11 @@ ] }, "locked": { - "lastModified": 1726509788, - "narHash": "sha256-PmCmO8NDKzwHrTp9Ox/rcLiCYivqIpZlnLk8wZRjv2I=", + "lastModified": 1727020652, + "narHash": "sha256-zwTXt1bcf+wycX389ZyJFzUO2gzCb16ButXxiX2iA7Y=", "owner": "nix-community", "repo": "plasma-manager", - "rev": "5a0c70a007837e2db01e0bb68971792e8653d32c", + "rev": "6f1db348fcb89fd6b0b9c32e279d29ee6b4d1272", "type": "github" }, "original": { @@ -549,7 +650,7 @@ "nixpkgs" ], "systems": "systems_4", - "treefmt-nix": "treefmt-nix" + "treefmt-nix": "treefmt-nix_2" }, "locked": { "lastModified": 1726715047, @@ -598,6 +699,7 @@ "home-manager": "home-manager", "lanzaboote": "lanzaboote", "nix-ld": "nix-ld", + "nixos-cosmic": "nixos-cosmic", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable", @@ -634,6 +736,27 @@ "type": "github" } }, + "rust-overlay_2": { + "inputs": { + "nixpkgs": [ + "nixos-cosmic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1726885519, + "narHash": "sha256-wrXknshJMRLv91KQD5d7ovUqJ70FlDM7XeG/upSsKgM=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "a66e16cb21e4428224925dbf1b66238c727dda0a", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "secrets": { "flake": false, "locked": { @@ -657,7 +780,7 @@ "nixpkgs": [ "nixpkgs" ], - "nixpkgs-stable": "nixpkgs-stable_2" + "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { "lastModified": 1726524647, @@ -682,7 +805,7 @@ "base16-kitty": "base16-kitty", "base16-tmux": "base16-tmux", "base16-vim": "base16-vim", - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "gnome-shell": "gnome-shell", "home-manager": "home-manager_2", "nixpkgs": [ @@ -764,6 +887,28 @@ } }, "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixos-cosmic", + "nix-update", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1719887753, + "narHash": "sha256-p0B2r98UtZzRDM5miGRafL4h7TwGRC4DII+XXHDHqek=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "bdb6355009562d8f9313d9460c0d3860f525bc6c", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_2": { "inputs": { "nixpkgs": [ "poetry2nix", diff --git a/flake.nix b/flake.nix index c3a620b..6a25a9a 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,12 @@ url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; }; + # DEs + nixos-cosmic = { + url = "github:lilyinstarlight/nixos-cosmic"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + # inputs.nixpkgs.follows = "nixpkgs"; + }; plasma-manager = { url = "github:nix-community/plasma-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -80,23 +86,6 @@ # image = "anime/jjk/satoru-gojo-jujutsu-kaisen-5k-ac.jpg"; # image = "anime/gruvbox/skull2.png"; image = "anime/gruvbox/boonies.png"; - # secure-boot = [ - # lanzaboote.nixosModules.lanzaboote - # ({ - # pkgs, - # lib, - # ... - # }: { - # environment.systemPackages = [pkgs.sbctl]; - # boot = { - # loader.systemd-boot.enable = lib.mkForce false; - # lanzaboote = { - # enable = true; - # pkiBundle = "/etc/secureboot"; - # }; - # }; - # }) - # ]; overlay-unstable = final: prev: { unstable = import nixpkgs-unstable { inherit system; diff --git a/hosts/yhwach/configuration.nix b/hosts/yhwach/configuration.nix index d31fcc8..ad804c7 100644 --- a/hosts/yhwach/configuration.nix +++ b/hosts/yhwach/configuration.nix @@ -4,10 +4,6 @@ config, ... }: { - # imports = [ - # ../../modules/nixos - # ]; - # Set hostname networking.hostName = lib.mkForce "yhwach"; # Define your hostname. @@ -20,6 +16,8 @@ # Set system time time.hardwareClockInLocalTime = true; + cosmic.enable = true; + # Eanble fingerprint for framework laptop # fingerprint.enable = true; diff --git a/modules/nixos/desktop/cosmic.nix b/modules/nixos/desktop/cosmic.nix new file mode 100644 index 0000000..6049968 --- /dev/null +++ b/modules/nixos/desktop/cosmic.nix @@ -0,0 +1,21 @@ +{ + inputs, + lib, + config, + ... +}: { + imports = [ + inputs.nixos-cosmic.nixosModules.default + ]; + + options.cosmic.enable = lib.mkEnableOption "Enable System76 DE: Cosmic (Alpha)"; + + config = lib.mkIf config.cosmic.enable { + nix.settings = { + substituters = ["https://cosmic.cachix.org/"]; + trusted-public-keys = ["cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="]; + }; + + services.desktopManager.cosmic.enable = true; + }; +} diff --git a/modules/nixos/desktop/default.nix b/modules/nixos/desktop/default.nix index 6d3fa7e..3422ed4 100644 --- a/modules/nixos/desktop/default.nix +++ b/modules/nixos/desktop/default.nix @@ -5,6 +5,7 @@ ... }: { imports = [ + ./cosmic.nix ./gnome.nix ./hyprland.nix ./kde.nix @@ -21,6 +22,7 @@ # sway.enable = lib.mkForce false; # hyprland.enable = lib.mkForce false; + cosmic.enable = lib.mkDefault false; gnome.enable = lib.mkDefault true; kde.enable = lib.mkDefault false; sway.enable = lib.mkDefault true;