feature(cosmic): enable cosmic desktop

This commit is contained in:
Serĉanto de Scio 2024-09-25 11:36:49 +10:00
parent 97f5970e76
commit 6287bf357d
Signed by: sercanto
GPG key ID: A4122FF3971B6865
8 changed files with 302 additions and 12 deletions

View file

@ -897,6 +897,30 @@
"type": "github" "type": "github"
} }
}, },
"cosmicDesktop": {
"inputs": {
"flake-compat": "flake-compat_13",
"nix-update": "nix-update",
"nixpkgs": [
"nixpkgsUnstable"
],
"nixpkgs-stable": "nixpkgs-stable",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1727141746,
"narHash": "sha256-4QPbRdvBy1MDJ5sVztFQsAl3nG3zYcVdb7IQSLmNaXs=",
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"rev": "738a6c45f23096b8e9cd6036e547955fa81f960d",
"type": "github"
},
"original": {
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"type": "github"
}
},
"crane": { "crane": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -998,7 +1022,7 @@
"cardano-playground": "cardano-playground", "cardano-playground": "cardano-playground",
"cardano-shell": "cardano-shell_7", "cardano-shell": "cardano-shell_7",
"cardano-wallet-unpatched": "cardano-wallet-unpatched", "cardano-wallet-unpatched": "cardano-wallet-unpatched",
"flake-compat": "flake-compat_13", "flake-compat": "flake-compat_14",
"nix-bundle-exe": "nix-bundle-exe", "nix-bundle-exe": "nix-bundle-exe",
"nixpkgs": "nixpkgs_30", "nixpkgs": "nixpkgs_30",
"tullia": "tullia_7" "tullia": "tullia_7"
@ -1580,6 +1604,22 @@
} }
}, },
"flake-compat_13": { "flake-compat_13": {
"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_14": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1635892615, "lastModified": 1635892615,
@ -1595,7 +1635,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_14": { "flake-compat_15": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1650374568, "lastModified": 1650374568,
@ -1611,7 +1651,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_15": { "flake-compat_16": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1696426674,
@ -1759,6 +1799,28 @@
} }
}, },
"flake-parts": { "flake-parts": {
"inputs": {
"nixpkgs-lib": [
"cosmicDesktop",
"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-parts_2": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"nix", "nix",
@ -3923,7 +3985,7 @@
}, },
"nix-nomad_7": { "nix-nomad_7": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_14", "flake-compat": "flake-compat_15",
"flake-utils": [ "flake-utils": [
"daedalus", "daedalus",
"tullia", "tullia",
@ -4004,6 +4066,29 @@
"type": "github" "type": "github"
} }
}, },
"nix-update": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": [
"cosmicDesktop",
"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"
}
},
"nix2container": { "nix2container": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
@ -4216,8 +4301,8 @@
}, },
"nix_4": { "nix_4": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_15", "flake-compat": "flake-compat_16",
"flake-parts": "flake-parts", "flake-parts": "flake-parts_2",
"git-hooks-nix": "git-hooks-nix", "git-hooks-nix": "git-hooks-nix",
"libgit2": "libgit2", "libgit2": "libgit2",
"nixpkgs": "nixpkgs_36", "nixpkgs": "nixpkgs_36",
@ -4972,6 +5057,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable": {
"locked": {
"lastModified": 1726969270,
"narHash": "sha256-8fnFlXBgM/uSvBlLWjZ0Z0sOdRBesyNdH0+esxqizGc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "23cbb250f3bf4f516a2d0bf03c51a30900848075",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1675758091, "lastModified": 1675758091,
@ -6017,7 +6118,7 @@
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay_2"
}, },
"locked": { "locked": {
"lastModified": 1718869541, "lastModified": 1718869541,
@ -6037,6 +6138,7 @@
"inputs": { "inputs": {
"cardano-node": "cardano-node", "cardano-node": "cardano-node",
"colmena": "colmena", "colmena": "colmena",
"cosmicDesktop": "cosmicDesktop",
"daedalus": "daedalus", "daedalus": "daedalus",
"iohkNix": "iohkNix_6", "iohkNix": "iohkNix_6",
"nix": "nix_4", "nix": "nix_4",
@ -6047,6 +6149,27 @@
} }
}, },
"rust-overlay": { "rust-overlay": {
"inputs": {
"nixpkgs": [
"cosmicDesktop",
"nixpkgs"
]
},
"locked": {
"lastModified": 1727058553,
"narHash": "sha256-tY/UU3Qk5gP/J0uUM4DZ6wo4arNLGAVqLKBotILykfQ=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "edc5b0f896170f07bd39ad59d6186fcc7859bbb2",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_2": {
"inputs": { "inputs": {
"flake-utils": [ "flake-utils": [
"ragenix", "ragenix",
@ -6544,6 +6667,28 @@
"type": "github" "type": "github"
} }
}, },
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"cosmicDesktop",
"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"
}
},
"tullia": { "tullia": {
"inputs": { "inputs": {
"nix-nomad": "nix-nomad", "nix-nomad": "nix-nomad",

View file

@ -4,6 +4,10 @@
inputs = { inputs = {
cardano-node.url = "github:input-output-hk/cardano-node/?ref=1.35.7"; cardano-node.url = "github:input-output-hk/cardano-node/?ref=1.35.7";
colmena.url = github:zhaofengli/colmena/?ref=v0.4.0; colmena.url = github:zhaofengli/colmena/?ref=v0.4.0;
cosmicDesktop = {
url = github:lilyinstarlight/nixos-cosmic;
inputs.nixpkgs.follows = "nixpkgsUnstable";
};
daedalus.url = github:input-output-hk/daedalus/?ref=6.0.0; daedalus.url = github:input-output-hk/daedalus/?ref=6.0.0;
iohkNix.url = github:input-output-hk/iohk-nix/?ref=df1da282f996ec46b33379407df99613a1fbafdd; iohkNix.url = github:input-output-hk/iohk-nix/?ref=df1da282f996ec46b33379407df99613a1fbafdd;
nix.url = github:NixOS/nix/?ref=2.24.6; nix.url = github:NixOS/nix/?ref=2.24.6;

View file

@ -7,7 +7,6 @@
imports = [ imports = [
../../hardware/system76_thelioMira.nix # Include results of the hardware scan. ../../hardware/system76_thelioMira.nix # Include results of the hardware scan.
../../profiles/cron-craige.nix # Provide Craige's cron jobs ../../profiles/cron-craige.nix # Provide Craige's cron jobs
../../profiles/desktopCraige.nix # Craige's desktop tools and apps
../../profiles/haskell-dev.nix # Haskell dev environment ../../profiles/haskell-dev.nix # Haskell dev environment
../../profiles/host_common.nix # Common host configuration options ../../profiles/host_common.nix # Common host configuration options
../../profiles/iog.nix # IOHK environment ../../profiles/iog.nix # IOHK environment
@ -16,7 +15,6 @@
../../profiles/nix-community.nix # Nix community aarch64 tooling ../../profiles/nix-community.nix # Nix community aarch64 tooling
../../profiles/nixpkgs-dev.nix # Nix pkgs dev tools ../../profiles/nixpkgs-dev.nix # Nix pkgs dev tools
../../profiles/openssh.nix # Enable and configure openssh ../../profiles/openssh.nix # Enable and configure openssh
../../profiles/pantheon.nix # Enable and configure the pantheon desktop
../../profiles/pipewire.nix # Enable and pipewire audio system ../../profiles/pipewire.nix # Enable and pipewire audio system
../../profiles/xmonad.nix # Xmonad desktop environment ../../profiles/xmonad.nix # Xmonad desktop environment
../../profiles/yubikey.nix # Yubikey tooling ../../profiles/yubikey.nix # Yubikey tooling
@ -51,10 +49,12 @@
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [
anonymousPro anonymousPro
cascadia-code # onospaced font that includes programming ligatures
dejavu_fonts # A typeface family based on the Bitstream Vera fonts dejavu_fonts # A typeface family based on the Bitstream Vera fonts
fira-code # Monospace font with programming ligaturess fira-code # Monospace font with programming ligaturess
font-awesome font-awesome
hack-font # A typeface designed for source code hack-font # A typeface designed for source code
iosevka # Versatile typeface for code, from code
jetbrains-mono jetbrains-mono
open-sans # Used in in my polybar configuration open-sans # Used in in my polybar configuration
xkcd-font # Font based handwriting in xkcd comics xkcd-font # Font based handwriting in xkcd comics

View file

@ -1,3 +1,5 @@
[ [
./profiles/cosmicDesktop
./profiles/starship ./profiles/starship
./roles/desktop
] ]

View file

@ -0,0 +1,26 @@
# Cosmic is a software platform for designing beautiful user experiences
{
config,
inputs,
lib,
pkgs,
...
}:
with lib; let
cfg = config.profiles.cosmicDesktop;
cosmicDesktop = inputs.cosmicDesktop;
in {
options.profiles.cosmicDesktop = {
enable = mkEnableOption "to enable the Cosmic desktop.";
};
config = mkIf (cfg.enable) {
nix.settings = {
substituters = ["https://cosmic.cachix.org/"];
trusted-public-keys = ["cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="];
};
services = {
desktopManager.cosmic.enable = true;
displayManager.cosmic-greeter.enable = true;
};
};
}

View file

@ -0,0 +1,108 @@
# Desktop role
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.roles.desktop;
in {
options.roles.desktop = {
enable = mkEnableOption "to enable the desktop role.";
};
config = mkIf (cfg.enable) {
environment.systemPackages = with pkgs; [
brave # Privacy-oriented browser
chromium
element-desktop # A feature-rich client for Matrix.org
firefox # A web browser built from Firefox source tree
librewolf # Firefox fork, focused on privacy, security and freedom
gnome.gnome-tweaks # A tool to customize advanced GNOME 3 options
krita # A free and open source painting application
libreoffice-fresh # Comprehensive, professional-quality productivity suite
mplayer # A movie player that supports many video formats
nextcloud-client # Nextcloud desktop client
pwgen # Password generator
rsync
shotwell # Photo organizer
signal-desktop # Private, simple, and secure messenger
usbutils # Tools for working with USB devices, such as lsusb
xorg.libxcb # X C binding
];
networking = {
networkmanager.enable = true; # Enables network support via NetworkManager.
firewall.enable = true;
};
nix.settings = {
substituters = ["https://cosmic.cachix.org/"];
trusted-public-keys = ["cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="];
};
services = {
acpid.enable = true; # A daemon for delivering ACPI events to userspace programs
blueman.enable = true; # GTK-based Bluetooth Manager
devmon.enable = true; # Enable external device automounting.`
displayManager = {
defaultSession = "cosmic"; # Set GNOME as the default session
};
libinput = {
enable = true; # Enable touchpad support.
touchpad = {
tapping = true;
tappingButtonMap = "lrm"; # Set the touchpad button mappeing
};
};
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
};
udev.packages = [
pkgs.android-udev-rules # Android udev rules list
];
udisks2.enable = true; # Enable udisks2
};
sound.enable = true; # Enable sound.
security.rtkit.enable = true; # realtime scheduling for sound
# Configure common hardware settings
hardware = {
pulseaudio = {
enable = false;
};
bluetooth = {
enable = true; # Enable bluetooth
settings = {
General = {
Enable = "Source,Sink,Media,Socket";
NoPlugin = "sap";
};
Policy = {AutoEnable = "true";};
};
};
opengl.enable = true;
};
# Configure libreWolf and Chromium
nixpkgs.config = {allowUnfree = true;};
profiles.cosmicDesktop.enable = true;
programs = {
chromium = {
enable = true;
homepageLocation = "https://start.duckduckgo.com/";
};
};
# Groups to add
users.groups = {
audio.members = ["craige" "fiona" "hamish" "logan" "xander"];
libvirtd.members = ["craige" "fiona" "hamish" "logan" "xander"];
networkmanager.members = ["craige" "fiona" "hamish" "logan" "xander"];
};
};
}

View file

@ -2,6 +2,7 @@
self, self,
cardano-node, cardano-node,
colmena, colmena,
cosmicDesktop,
daedalus, daedalus,
nix, nix,
nixpkgs, nixpkgs,
@ -36,7 +37,10 @@ in {
}; };
}; };
defaults = { defaults = {
imports = [./modules]; imports = [
./modules
cosmicDesktop.nixosModules.default
];
# make flake inputs accessible in NixOS # make flake inputs accessible in NixOS
_module.args.inputs = inputs; _module.args.inputs = inputs;
profiles.starship.enable = true; profiles.starship.enable = true;
@ -146,6 +150,7 @@ in {
hosts/sanganto hosts/sanganto
ragenix.nixosModules.default ragenix.nixosModules.default
]; ];
roles.desktop.enable = true;
}; };
sercanto = { sercanto = {
imports = [ imports = [

View file

@ -26,11 +26,11 @@
desktopManager = { desktopManager = {
xterm.enable = false; # Disable NixOS default desktop manager. xterm.enable = false; # Disable NixOS default desktop manager.
gnome.enable = false; # Enable GNOME desktop environment gnome.enable = false; # Enable GNOME desktop environment
plasma5.enable = true; # Enable Plasma desktop environment plasma5.enable = false; # Enable Plasma desktop environment
}; };
displayManager = { displayManager = {
gdm.enable = false; # Enable the GNOME display manager gdm.enable = false; # Enable the GNOME display manager
lightdm.greeters.pantheon.enable = true; lightdm.greeters.pantheon.enable = false;
}; };
windowManager = { windowManager = {
# Open configuration for the window manager. # Open configuration for the window manager.