From adab63ab357d0ea73696ab1227f3973e13ec727b Mon Sep 17 00:00:00 2001 From: Gustav Bruhn Date: Mon, 17 Mar 2025 19:21:14 +0100 Subject: [PATCH] switch to cosmic --- flake.lock | 75 ++++++++++++++++++++++++++++++- flake.nix | 11 ++++- hosts/framework/configuration.nix | 6 +-- modules/nixos/cosmic.nix | 13 ++++++ 4 files changed, 99 insertions(+), 6 deletions(-) create mode 100644 modules/nixos/cosmic.nix diff --git a/flake.lock b/flake.lock index 49723a6..51b064f 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "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" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -20,7 +36,59 @@ "type": "github" } }, + "nixos-cosmic": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1742209773, + "narHash": "sha256-+d9zNzXHK/qQnWfFrjFxmCNJLm1JShsLNNViJxnKIpI=", + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "rev": "0b2d5feae25fe6176b5844a689712a3a13954f12", + "type": "github" + }, + "original": { + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "type": "github" + } + }, "nixpkgs": { + "locked": { + "lastModified": 1742069588, + "narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1742136038, + "narHash": "sha256-DDe16FJk18sadknQKKG/9FbwEro7A57tg9vB5kxZ8kY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a1185f4064c18a5db37c5c84e5638c78b46e3341", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1742069588, "narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=", @@ -39,7 +107,12 @@ "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixos-cosmic": "nixos-cosmic", + "nixpgs": [ + "nixos-cosmic", + "nixpkgs" + ], + "nixpkgs": "nixpkgs_2" } } }, diff --git a/flake.nix b/flake.nix index ac598d3..a9275c1 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,8 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpgs.follows = "nixos-cosmic/nixpkgs"; + nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic"; home-manager = { url = "github:nix-community/home-manager"; @@ -10,7 +12,7 @@ }; }; - outputs = { self, nixpkgs, ... }@inputs: { + outputs = { self, nixpkgs, nixos-cosmic, ... }@inputs: { # use "nixos", or your hostname as the name of the configuration # it's a better practice than "default" shown in the video nixosConfigurations.framework = nixpkgs.lib.nixosSystem { @@ -18,6 +20,13 @@ modules = [ ./hosts/framework/configuration.nix inputs.home-manager.nixosModules.default + { + nix.settings = { + substituters = ["https://cosmic.cachix.org/"]; + trusted-public-keys = ["cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="]; + }; + } + nixos-cosmic.nixosModules.default ]; }; }; diff --git a/hosts/framework/configuration.nix b/hosts/framework/configuration.nix index 0636681..8e30a27 100644 --- a/hosts/framework/configuration.nix +++ b/hosts/framework/configuration.nix @@ -9,6 +9,7 @@ [ # Include the results of the hardware scan. ./hardware-configuration.nix inputs.home-manager.nixosModules.default + ./modules/nixos/cosmic.nix ]; # Bootloader. @@ -46,11 +47,8 @@ }; # Enable the X11 windowing system. - services.xserver.enable = true; + # services.xserver.enable = true; - # Enable the GNOME Desktop Environment. - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome.enable = true; # Configure keymap in X11 services.xserver.xkb = { diff --git a/modules/nixos/cosmic.nix b/modules/nixos/cosmic.nix new file mode 100644 index 0000000..11ef7e3 --- /dev/null +++ b/modules/nixos/cosmic.nix @@ -0,0 +1,13 @@ +{configs, pkgs, ...} + +{ + services.desktopManager.cosmic.enable = true; + services.displayManager.cosmic-greeter.enable = true; + + enviroment.sessionVariable.COSMIC_DATA_CONTROLL_ENABLED = 1; + services.geoclue2.enable = true; + + enviroment.systemPackages = with pkgs; [ + cosmic-reader + ] +}